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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to clear all contents from gridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

53977 Dec 26,2006 05:21 PM UTC Dec 27,2006 02:10 PM UTC WinForms 2
loading
Tags: GridControl
Himanshu
Asked On December 26, 2006 05:21 PM UTC

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 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

Himanshu
Replied On 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

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.

Warning Icon 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.Close Icon

;