This is a migrated thread and some comments may be shown as answers.
Binding problem with elements already displayed when view model changes
1 Answer 8 Views
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 08 Aug 2011, 11:28 AM
Hi,

We are binding a TreeView to a hierarchical data structure from a "flate" collection.

I have used your own examples as a starting point.
We have chosen to render our own Check Box in the item template.

This is all working great, and initial display of tree items works fine.

BUT...

We have a background service that is refreshing the data and updating the itmes in the TreeViews ItemsSource propertyy (the observiblecollection we are binding to)

This service will alter a property on the Item that each tree node is bound to. The item IS raising the NotifyProperty event and we are also raising the collection changed events.

THE PROBLEM IS...
Any items that are alreadyy expanded (and therefore in the visual tree) do not get their text updated inspite of the fact that they are bound to a property on the item that IS RAISING THE PROPERTY CHANGED event.
Other elements in the tree view appear to be respecting the data changes so long as they are exposed visually AFTER the background service is refreshing them.

My question is simple - is there ANY WAY that we can get the nodes in the tree to be refreshed (the text and check box states) when a background process changes their bound data item - this surely should be happening and surely should be working so long as the notify property changed event is firing. Why isn't it happening ?...

Please help us with this...

Thanks.

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 11 Aug 2011, 12:03 PM
Hi Paul,

We cannot tell for sure why this doesn't work in your situation. You can send us part of your code( ViewModels and XAML) so that we could get into your situation quicker and this way be better able to assist you. Thank you for your cooperation.

Kind regards,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Asked by
Paul
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or