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

Thread ID:





49449 Sep 19,2006 10:52 AM UTC Sep 19,2006 11:53 AM UTC WinForms 2
Tags: Grouping
Asked On September 19, 2006 10:52 AM UTC

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 11:45 AM UTC

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.

//Reset the Column collection in a grid.

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

Best Regards,

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

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;

Let me know if this helps.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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