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

Reload/refresh treview

2 Answers 612 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Fredrik
Top achievements
Rank 1
Veteran
Iron
Fredrik asked on 21 Sep 2020, 10:36 AM

Can I manually refresh or update a TreeView from my ViewModel?

I have a TreeView whitch is connected to a multiple level Dictionary.

Each branch in the TreeView has a number on it. The number represents the number of notes added to the branch combined with the number of notes on the branches below.

When I remove or add a note on a branch the number on the branch is updated.

How ever the number on the branches above it are not updated, even though I refreshed the whole dictionary (all the parents and children).

Thanks in advance!

2 Answers, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 24 Sep 2020, 09:36 AM

Hello Fredrik,

For the rows of the RadTreeView to respond to changes, the bound data items need to implement the INotifyPropertyChanged interface. If that is the case, when you update the value of a child branch, you need to also ensure that you invoke a property changed notification for its parents as well.

If you would kindly provide a small sample project which demonstrates your setup and the issue you observe, I'd be more than happy to suggest a possible solution. Would you find this possible?

Regards,
Dilyan Traykov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

0
Fredrik
Top achievements
Rank 1
Veteran
Iron
answered on 28 Sep 2020, 07:42 AM
Thank you for the reply. I realized it was a caching issue.
Tags
TreeView
Asked by
Fredrik
Top achievements
Rank 1
Veteran
Iron
Answers by
Dilyan Traykov
Telerik team
Fredrik
Top achievements
Rank 1
Veteran
Iron
Share this question
or