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

how to know the RadTreeView virtualization is loaded new items and disposed unused items

1 Answer 149 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ramachandraiah
Top achievements
Rank 1
Ramachandraiah asked on 24 Aug 2017, 06:36 PM

Hi, 

As part of application development, we are using the Telerik:RadTreeView to support UI viertualization in the tree view.

We have a requirement to make a data subscription to each tree view item after finish loading all of the items... basically would like to when virtualizaiton loaded the visible items and unloaded the invisible items...

 

Is there are any event or sample code to refer for above functionality?

I am new to this... and gone through RadTreeView documentation, but didnt find any suitable events for this..

Thanks

Rama. 

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 29 Aug 2017, 10:05 AM
Hello Rama,

You can use the ItemPrepared event to know when a RadTreeViewItem is prepared into the viewport. By preparing I mean, creating of the container or changing its data context. By default the UI virtualization will re-use the containers so most of the time they won't be unloaded. 

Currently, there is no event for the moment when the item context is changed (unloaded). It is possible to use the IsVisibleChanged and Unloaded event of the RadTreeViewItem. The Unloaded event will be fired when the container is no longer needed, therefore it is no longer used. And the IsVisibleChanged will be fired in some cases when the container is recycled.

If you tell me what exactly you want to achieve I could think of a possible solution for your scenario.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
TreeView
Asked by
Ramachandraiah
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or