How to clear all contents from gridControl

Hi All,

Here is a quick question:
I have a grid which has a a number of cells.
Each of these cells have a checkbox, a description text and also it has the background color set.

I was wondering is there any way through which all these contents could be removed in one go so that gridControl is available as if it was new?

Thanks in advance,
Himanshu

2 Replies

AD Administrator Syncfusion Team December 27, 2006 04:01 AM UTC

Hi Himanshu,

Use the ClearCells method to clear specified cell ranges in a grid.

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

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

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

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

Best Regards,
Haneef


HI Himanshu December 27, 2006 02:10 PM UTC

Hi Haneef,

Thanks for the reply.

The suggested approach is working fine.

Thanks again.

Regards,
Himanshu

>Hi Himanshu,

Use the ClearCells method to clear specified cell ranges in a grid.

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

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

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

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

Best Regards,
Haneef

Loader.
Up arrow icon