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

The GridViewRow's IsExpanded property and Collection Update

2 Answers 78 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Kate
Top achievements
Rank 1
Kate asked on 16 Oct 2010, 02:26 AM

 

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 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 21 Oct 2010, 09:04 AM
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
0
Kate
Top achievements
Rank 1
answered on 21 Oct 2010, 10:45 AM
We've solved the problem by adding IsCollapsedByUser property to our DataItem.
Thank you a lot for your reply!
Tags
TreeListView
Asked by
Kate
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Kate
Top achievements
Rank 1
Share this question
or