View previous topic :: View next topic |
Author |
Message |
jmaeding
Joined: 11 Apr 2008 Posts: 67
|
Posted: Thu Mar 03, 2011 1:59 am Post subject: How to react to a cell value changing from datasource |
|
|
My datasource works great with the VT, I can change values and the tree updates fine.
What I want to do is tell the tree to change a property of a cell's cellwidget when its value changes from a datasource update (not the user editing the cell).
I could set up events that watch for changes in the datasource, then update the tree, but i wanted to see if i could react to the cells values changing directly.
Is there an event to hook to for this? _________________ James M |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Mar 03, 2011 9:56 pm Post subject: |
|
|
There are only two ways for Virtual Tree to know that a cell's value has changed - and so update itself.
The first is if your data source implements the IBindingList interface. The data source should raise the ListChanged event (with the ListChangeType set to ItemChanged) when an item within the list changes. Usually you do this by the item implementing the IPropertyNotify interface and the list receives change notifications from the contained items using this interface and the raises the ListChanged event.
The second way is for you to call VirtualTree.UpdateRowData() manually. This forces virtual tree to requery the data for the displayed cell widgets and update them. _________________ Infralution Support |
|
Back to top |
|
|
|