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

Clearing a grid


How does one clear a Grid control in WPF? Preferably in a way to reset it to what it was when it first initialized. The WinForms ClearCells method doesn't seem to exist in the GridControl in WPF.

2 Replies

AA Arulraj A Syncfusion Team January 7, 2019 02:03 AM

Hi Jonathan, 
Thanks for using Syncfusion products.  
The GridControl works on how you define the styles, either through QueryCellInfo or manually setting those styles.  
  1. Through QueryCellInfo, you would have an underlying store, which you could simply set it to NULL and reset the Model.RowCount and Model.ColumnCount.
  2. Manually applying styles, then you can clear the internal lists maintained in the Model as,
Please let us know if you need any further assistance on this. 

Arulraj A 

JO Jonathan January 7, 2019 03:40 AM

Thanks. The first option solved it.

Live Chat Icon For mobile
Up arrow icon