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

Update grid when data source changes w/o INotifyPropertyChanged

2 Answers 163 Views
GridView
This is a migrated thread and some comments may be shown as answers.
JP
Top achievements
Rank 1
JP asked on 06 Jan 2009, 05:14 PM
Hello,

I am binding the the RadGridView to a collection of objects that do not implement INotifyPropertyChanged or INotifyCollectionChanged.  Specifically, I'm using the WorkItemCollection and WorkItem objects from Microsoft's Team Foundation Server object model.  The WorkItem object has an event that is raised whenever a field is modified, so I do have a way of knowing exactly when an object changes and which field has changed.  Given that, is there a way to manually update the grid without rebinding the entire grid?  Perhaps by just updating a single row or cell?

Thanks,

Joel


2 Answers, 1 is accepted

Sort by
0
Accepted
Hristo Deshev
Telerik team
answered on 09 Jan 2009, 04:11 PM
Hi Joel,

I don't think there is a nice way to do that. Maybe the most elegant way to implement that is to use your own observable collection referencing WorkItemCollection and contains objects wrapping the WorkItem ones and implementing INotifyPropertyChanged. This way you can:
 * Handle collection change events raised by WorkItemCollection and raise CollectionChanged events for your observable collection;
 * Handle work item property changes raised by WorkItem objects and raise PropertyChanged events from your wrapper objects.

I hope that does not sound too scary.
Regards,
Hristo Deshev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
JP
Top achievements
Rank 1
answered on 09 Jan 2009, 04:53 PM
Hi Hristo,

Thanks for your reply.  I figured that what you suggested would be the route I would have to go.  I just thought that I'd ask the experts to make sure that there wasn't some feature of the grid or some easy method that I was overlooking.

Thanks,

Joel
Tags
GridView
Asked by
JP
Top achievements
Rank 1
Answers by
Hristo Deshev
Telerik team
JP
Top achievements
Rank 1
Share this question
or