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.
Unfortunately, activation email could not send to your email. Please try again.

How to clear all contents from gridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

53977 Dec 26,2006 12:21 PM Dec 27,2006 09:10 AM Windows Forms 2
loading
Tags: GridControl
Himanshu
Asked On December 26, 2006 12:21 PM

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

Administrator [Syncfusion]
Replied On December 26, 2006 11:01 PM

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

Himanshu
Replied On December 27, 2006 09:10 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;