The GridViewRow's IsExpanded property and Collection Update

3 posts, 0 answers
  1. Kate
    Kate avatar
    17 posts
    Member since:
    Jul 2010

    Posted 15 Oct 2010 Link to this post


    Hello! I have a problem with expanding rows of RadTreeListView. When my control loads I call 
    ExpandAllHierarchyItems() of RadTreeListView. After that if I expand/collapse rows manually and then update my collection all rows become collapsed. How can I save IsExpanded values of all my rows that user set to use it after collection updates? 

  2. Pavel Pavlov
    Pavel Pavlov avatar
    2039 posts

    Posted 21 Oct 2010 Link to this post

    Hi Kate,

    As I do not have details on your specific usage scenario , here are some general thoughts :

    RadTreeListiView has an internal state preservation logic - a cache that stores /restores  the expand state of the items . This logic relies on the item , meaning the state is kept for data items rather than for UI elements.

    If you change/update  the item, the new instance is not present in the cache yet , therefore it gets the default collapsed state.

    This means you will need to implement an external mechanism ( e.g. a dictionary or a hashtable ) to store the state and set it after updates.

    In case you can show me your project , I will be glad to have a look at it and give some additional assistance on implementing the above suggested approach .

    All the best,
    Pavel Pavlov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Kate
    Kate avatar
    17 posts
    Member since:
    Jul 2010

    Posted 21 Oct 2010 Link to this post

    We've solved the problem by adding IsCollapsedByUser property to our DataItem.
    Thank you a lot for your reply!
Back to Top