This is a migrated thread and some comments may be shown as answers.

[Solved] Empty Grid Rows

2 Answers 96 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alan Fisher
Top achievements
Rank 1
Alan Fisher asked on 06 Sep 2010, 06:51 AM
I know this is probably a fundamental question, but can someone tell me how to delete all the rows from a gridview?

I am modifiying someone elses code so am missing something. 
When I tried grid.Items.Clear() , i get the error "ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead."

How do i clear the rows from ItemsSource?

2 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 06 Sep 2010, 07:35 AM
Hello Alan Fisher,

You could either set the ItemSrouce property to null or if you have direct access to the source collection and it implement INotifyPropertyChange you can call Clear() on that collection.


All the best,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Alan Fisher
Top achievements
Rank 1
answered on 06 Sep 2010, 11:50 PM
Thanks, that did the trick. I should have thought of that! 
Tags
GridView
Asked by
Alan Fisher
Top achievements
Rank 1
Answers by
Milan
Telerik team
Alan Fisher
Top achievements
Rank 1
Share this question
or