开发者

Dynamically updating individual cells in a data grid

开发者 https://www.devze.com 2023-01-13 03:53 出处:网络
I have an observable collection of Taxis. The Taxi class has properties like Taxi_No, Name, Current_Locn, Bill_Amount.

I have an observable collection of Taxis. The Taxi class has properties like Taxi_No, Name, Current_Locn, Bill_Amount.

I have bound the observable collection to a wpf data grid. As a taxi is added or deleted from the collection, the changes are reflected in the data grid. But as the taxi moves through the city the location of the taxi changes(Current_Locn) and so does the bill amount. However, these changes are not dynamically reflected in the grid.

I understand that observable collection keep开发者_Go百科s only track of changes to the collection. But, how do I keep track of individual properties of each data item in the collection? Should I implement INotifyPropertyChanged on each property? and how do I bind it to the grid in such a case?


I just need to implement INotifyPropertyChanged on the Taxi class.

0

精彩评论

暂无评论...
验证码 换一张
取 消