Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to preserve the expanded state of TreeList nodes when refreshing data

$
0
0

The example contains a helper class that can be used to save and load the current expanded / collapsed state of the XtraTreeList nodes. Please refer to How to preserve the expanded state of TreeList nodes when refreshing data article to learn more.

Question Comments

Added By: Peppomuck at: 7/14/2013 8:09:46 AM    

Why don't you save the node.Id's in a List<int> ?
That would be more type safe (instead of seraching by node.GetValue(node.TreeList.KeyFieldName) and safing object types in ArrayList)
Besides, your example doesn't match when you reassign (e.g. after saving and reloading data) the binding source or the KeyFieldName doesn't expect like in the example.

Added By: Trent Jones at: 2/25/2015 11:17:09 PM    

Is there a chance of this being implemented to the XtraTreeList Suite? I can imagine there are large amounts of people who use this code regularly.

Added By: Olejka (DevExpress Support) at: 2/26/2015 4:29:09 AM    

Hello,

Currently, we don't have plans to implement this option out of the box. We've implemented this solution to allow our users to manually save nodes' state. 
Nevertheless, thank you for your input. We will consider implementation of this feature in the future.

Added By: alvin johnson 1 at: 2/18/2016 11:44:05 AM    Hello Olejka,

I have used this class to save the state of treelist. On save button click I have initialized XView and TreeStateView(TreeList) classes. And after that I am calling the method SaveState(). But it never shows any expanded and selected nodes.

Am I doing something wrong?

After this I want to serialize these expanded and selected properties to load this treelist state.

Please give me the solution.
Added By: Nadezhda (DevExpress Support) at: 2/18/2016 2:35:43 PM    

Hello alvin,

To process your recent post more efficiently, I created a separate ticket on your behalf: How to save state after update. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.


Viewing all articles
Browse latest Browse all 7205

Trending Articles