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. Image for the cookie policy date
close icon

How to clear a gridcontrol ?

Hi,

How can i clear a GridControl object ?
i.e. i want to reset a GridControl object to it's initial state
(the state when it was first allocated).

I'm using SyncFusion Essential Studio WPF 7.3.0.20

Thanks.

P.OM
Reportive SA

1 Reply

MS Mohamed Suhaib Fahad A. Syncfusion Team September 9, 2009 05:44 AM UTC

Hi Puthirak,

Thanks for using Syncfusion products. There are two modes of usage with the Grid Control,

1) Using QueryCellInfo, this would load the data virtually, for resetting this, you just have to set the Model.RowCount & Model.ColumnCount values.

2) Static population of styles, if the GridStyleInfo objects are populated for the whole grid, then you should simply clear them,

this.Model.VolatileCellStyles.Clear();
this.Model.Data.Clear();

Finally, in both these methods you should force the grid to invalidate by calling, Model.InvalidateVisual(true).

Please let me know if this helps you out.

Thanks,
Fahad
Grid.WPF Team
Syncfusion Inc.,

Loader.
Live Chat Icon For mobile
Up arrow icon