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

2 posts, 0 answers
  1. Ramachandraiah
    Ramachandraiah avatar
    1 posts
    Member since:
    May 2015

    Posted 24 Aug 2017 Link to this post


    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..



  2. Martin Ivanov
    Martin Ivanov avatar
    2395 posts

    Posted 29 Aug 2017 Link to this post

    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.

    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.
Back to Top