If you populate a DataGrid using:
dataGrid.Items.Add(someObject);
Then you can use:
dataGrid.Items.Clear();
To delete all rows.
If you are attached to ItemsSource, for example:
dataGrid.ItemsSource = someCollection;
Then you should be able to set the ItemsSource to null and delete all rows.
EDIT:
Remember to update it:
dataGrid.Items.Refresh();
source
share