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

Changes to ObservableCollection not reflected in Grid

1 Answer 97 Views
GridView
This is a migrated thread and some comments may be shown as answers.
kilhoffer
Top achievements
Rank 1
kilhoffer asked on 04 Aug 2010, 04:21 PM
I have a fairly simple scenario. A non-hierarchical grid bound to an ObservableCollection<T>. The collection resides on a ViewModel. When I load the view, the grid displays data appropriately. A seperate control on the page can force a refresh of data in the ObservableCollection. That is, the collection is cleared and repopulated with new items based on the outside criteria. When the operation completes, I see a new count in the collection, but the rendered grid is unchanged. It was my understanding that the grid would respond to events raised by an ObservableCollection and that no additional handling was necessary. I'm aware of a Rebind method on the grid, which I could call to force a rebind, but as you may be aware, knowledge of controls in a ViewModel is not appropriate. 

Any ideas why the grid would not respond to changes in the collection? Also, if I must force this rebind using the Rebind method, what are some strategies to initiate this from the ViewModel without calling the grid directly from the ViewModel?

Thanks...

1 Answer, 1 is accepted

Sort by
0
kilhoffer
Top achievements
Rank 1
answered on 04 Aug 2010, 09:00 PM
Update: I just upgraded our version of Telerik controls to the Q2 release and the changes to the ObservableCollection seem to be working now. Not sure why it wasnt before, it's no longer an issue.
Tags
GridView
Asked by
kilhoffer
Top achievements
Rank 1
Answers by
kilhoffer
Top achievements
Rank 1
Share this question
or