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 dynamically clear grid control of records or data

Thread ID:

Created:

Updated:

Platform:

Replies:

49449 Sep 19,2006 06:52 AM Sep 19,2006 07:53 AM Windows Forms 2
loading
Tags: Grouping
jamesb
Asked On September 19, 2006 06:52 AM

I can''t seem to find a method to clear the grid control that has been previoulsy populated with data at runtime. All the samples that I''ve seen that populate the grid manually loops thru a recordset and populate the grid, so I can''t really set the grid Datasource property to null (matter of fact, I do not see that property).

Is there a easy way to clear out the grid control that I am not aware of?

Administrator [Syncfusion]
Replied On September 19, 2006 07:45 AM

Hi James,

To clear the grid without modifying the underlying datasource, you can call the GridColumnDescriptorCollection.Clear method

//For the Clear the Column collection in a grid.
this.grid.TableDescriptor.Columns.Clear();

//Reset the Column collection in a grid.
this.grid.TableDescriptor.Columns.Reset()

Sample: http://www.syncfusion.com/Support/user/uploads/GGCUpdate_74da1a58.zip

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On September 19, 2006 07:53 AM

Hi James,

Sorry for the inconvenience caused.

Are you using GridControl? If so, you can use the below code to resolve this

this.grid.Properties.ColHeaders = false;
this.grid.RowCount = 0;
this.grid.ResetVolatileData();

Let me know if this helps.

Thanks,
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.

;