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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Clearing a grid

Thread ID:





141801 Jan 4,2019 03:06 PM UTC Jan 7,2019 08:40 AM UTC WPF 2
Tags: GridControl
Jonathan Bleeker
Asked On January 4, 2019 03:06 PM UTC


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.

Arulraj A [Syncfusion]
Replied On January 7, 2019 07:03 AM UTC

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 

Replied On January 7, 2019 08:40 AM UTC

Thanks. The first option solved it.


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

Live Chat Icon For mobile
Live Chat Icon