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

How to clear GridDataBoundGrid in c#

Hi viewers ,

 I am very new to Syncfusion controls  let you help please 
 How I will clear Data in the GridDataBoundGrid using c#  in the "New" button click ;
( I am trying gdbgdata.datasource =null;,gdbgdata.model.rows.clear()) but its not working 
how i will finish this one please help me 
                                                        thank you in Advance 

1 Reply

AG Anish George Syncfusion Team October 24, 2014 11:29 AM UTC

Hi Venkaiah,

 

Thank you for using syncfusion products.

 

We would like to suggest you to use the ClearCells method for clearing the particular range of cells. Please make use of the below code snippet in you button click event for clearing a particular cell or range of cells.

 

C#:

//Clear the whole grid.
this.gridDataBoundGrid1.Model.ClearCells(GridRangeInfo.Table(),true); 

//Clear the 2th Row.
this. gridDataBoundGrid1.Model.ClearCells(GridRangeInfo.Row(2),true); 

//Clear the 2th Column
this. gridDataBoundGrid1.Model.ClearCells(GridRangeInfo.Col(2),true);

//Clear the (2,2) cell
this. gridDataBoundGrid1.Model.ClearCells(GridRangeInfo.Cell(2,2),true);

 

 

Please let us know if you need any further assistance.

 

Regards,

Anish


Loader.
Live Chat Icon For mobile
Up arrow icon