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

[Solved] Issue with Gridview Refreshing after changing objects in databound collection

1 Answer 121 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.
Ryan
Top achievements
Rank 1
Ryan asked on 06 Jan 2011, 10:55 PM
I have a project which is using a RadGridView databound to an ObservableCollection. When the user clicks on a cell in the gridview a modified RadContextMenu pops up with several fields (textboxes and datepickers) related to the cell the clicked on. The user can modify that data and then click a Save button. The Save button updates the underlying datasource via a web service. Once that update is complete it updates the objects inside of the ObservableCollection which the RadGridView is bound to, and fires a PropertyChanged event for the ObservableCollection. This keeps me from having to go retrieve all of the data that my web service pulls back when only one item has been modified.

My problem is that when the objects inside ObservableCollection are updated, the GridView is not refreshing. If I click on the cell which has its underlying information changed, then it refreshes. Clicking anywhere else on the GridView does not update that cell. I've tried firing PropertyChanged events for the individual properties and that doesn't seem to work either. I assume there is some event being fired when I click on a cell that is updating the GridView. Is there a way to call that event manually in code? Is there some property on the GridView that needs to be set to correctly update?

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 07 Jan 2011, 08:27 AM
Hi,

 Can you clarify how you use PropertyChanged in ObservableCollection? Are you referring to CollectionChanged? Generally bindings in cells will react on PropertyChanged and the grid on CollectionChanged.

Greetings,
Vlad
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
GridView
Asked by
Ryan
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or