UI/Tree Node doesn't update on TreeListView

3 posts, 0 answers
  1. Rocky
    Rocky avatar
    3 posts
    Member since:
    May 2012

    Posted 10 Apr 2013 Link to this post

    Hi all,

    I have an application which is using RadTreeListView to bind and display as a tree. The ItemSource is binded from ViewModel with type is RadObservableCollection and declared:

    ItemsSource="{Binding HistoryList, Mode=TwoWay,

    The issue is when I add a new node to HistoryList then call RaisePropertyChange of HistoryList, the UI of RadTreeListView doesn't update even though the data added.

    this.RaisePropertyChanged(x => x.HistoryList);

    Then if I use reset() method of RadObservableCollection, the UI is updated but float top the top of view. So the question is how can I handle with it? I mean I wan to keep the state/position of node that I selected.. not jump or float.

    This video gets better for you to understand: http://screencast.com/t/iLa3XWsa

    Thank you
  2. Rocky
    Rocky avatar
    3 posts
    Member since:
    May 2012

    Posted 11 Apr 2013 Link to this post

    Can someone help me please?
  3. DevCraft R3 2016 release webinar banner
  4. Maya
    Maya avatar
    4062 posts

    Posted 17 Apr 2013 Link to this post

    Hi Rocky,

    Generally, if you are working with observable collection, you do not need to call property changed since the collection will be aware of add/remove changes. You can verify that by handling CollectionChanged event and check whether it is called on adding the new item.
    Considering scrolling to the top on resetting the collection, it will be the expected behavior. What you can try is either to save the position of the scroll viewer (through its offset properties) or call ScrollIntoView method of the tree list view. 

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top