We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to clear the entire data in GridDataBoundGrid

i tried with this code to clear all the cells Data.. But it's not working Properly....
foreach (Control ctrl in clrctrls)
{
    if (ctrl.GetType() == typeof(GridDataBoundGrid))
       {
             GridDataBoundGrid Gdbg = ctrl as GridDataBoundGrid;
             Gdbg.Model.Clear(true);
             Gdbg.Refresh();
        }
}
thanks in Advance.....

3 Replies

MS Maniratheenam Sehar Syncfusion Team September 4, 2014 04:54 AM UTC

Hi Narry,

 

Thank you for your interest in Syncfusion Products.

 

Query:

Clearing entire data in GridDataBoundGrid

We would like to let you know that we can clear the entire data of a cell in the grid by using the ClearCells method. Please refer the below code snippet.

CodeSnippet[C#]

this.gridDataBoundGrid1.Model.ClearCells(GridRangeInfo.Table(), true);

where the first argument denotes the range of cells that has to be cleared.

Second argument is a Boolean value. True, if you want to clear all the cell information. False, if you want to clear only the text.

 

Please let us know, if you have any concerns.

 

Regards,

ManiRatheenam S



NA Narry September 10, 2014 07:11 AM UTC

thanks for your reply.
With your code also i'm not getting clear the all cells data in griddataboundgrid. if it is possible please drop me some example as a attachment. thanks a lot...


MS Maniratheenam Sehar Syncfusion Team September 12, 2014 04:02 AM UTC

Hi Narry,

 

 

Sorry for the delay caused.

 

I’ve attached a sample for your better convenience.

Please let us know, if you’ve any concerns.

 

Regards,

ManiRatheenam S


Attachment: GDBsample_d22c9840.zip

Loader.
Live Chat Icon For mobile
Up arrow icon