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

Persistence of configuration after postback

1 Answer 133 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Paul Robertson
Top achievements
Rank 1
Paul Robertson asked on 05 May 2012, 01:06 PM

Dear all

I wonder if somebody could help clarify something about the persistence behaviour I should be expecting from the RadTreeView's EnableViewState property? I am not sure if I am seeing the behaviour by design or not ...

I have a RadTreeView control which does not appear to maintain its node display arrangement after a postback, in that if the user expands a node, after postback the node has been collapsed once more. Also, when it comes to the underlying datasource bindings etc of the RadTreeView control, it seems as though the control does not persist the Datasource property, for example, that is configured when the control first loads on the initial post of the page. For example, the RadTreeView in question binds to a hierarchical datasource object, but I am having to reconfigure the RadTreeView to a datasource object after each postback, which seems a little counter-intuitive, and a bit of an inefficiency that I would expect the RadTreeView control to avoid by maintaining the state of the datasource object. Perhaps the data configuration and hierarchy display changes would need to be made manually with a Session object instead?

However, I would be interested to know if this is the correct way to go about this issue, or whether I am missing something of importance. 

Thanks very much for any advise!

Regards

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 10 May 2012, 07:29 AM
Hi Poul,

 
The expand state of the nodes is kept in the client state of RadTreeView and does not depend on the EnableViewState property. In ViewState are kept some other properties that serve the overall behavior of the control. If you want to keep the expand state of nodes after postback you can refer to this Code Library.

 As for the binding to hierarchical datasource please refer to this help topic where a explained how to use it.

Hope this information will be helpful.

Regards,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
TreeView
Asked by
Paul Robertson
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or