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

on demand loading - refresh and keeping state of treenodw

3 Answers 70 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
erwin
Top achievements
Rank 1
Veteran
Iron
erwin asked on 15 May 2011, 02:27 PM
Hi,

in my app, I sometimes have to reload an unbound treeview because the underlying data changes. Now it would be nice to keep the state of the tree view (selected nodes, expanded state etc.) What's a good strategy to implement this?
I do have object identity information in an object in the Tag attribute, so I can find the logically identical nodes after a reload.
Thinking of maintaining maps of selected and expanded nodes so I can re-apply those attributes after reload. Is that a good idea?

I'm using demand loading for non-root nodes. Also I have to take into account, that there might be some nodes missing or additional nodes appearing at reload.
Has anybody implemented something similar?

Regards
Erwin

3 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 18 May 2011, 04:59 PM
Hi Erwin,

Thank you for this question. Yes, I can confirm that the solution to use maps (Dictionary or Hashtable collections) to keep your tree view settings is the best solution in this scenario. If you have any additional questions regarding this issue, I will be glad to help.

Greetings,
Julian Benkov
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 18 May 2011, 08:26 PM
Thanks Julian!
Implemented something in that direction but am stuck with another bug in RadTreeView: BringIntoView does not work for multi-selection TreeViews.

Regards
Erwin
0
Julian Benkov
Telerik team
answered on 23 May 2011, 10:15 PM
Hi Erwin,

As I said in your previous ticket, the issue is logged in our issue tracking system and it will be addressed in our upcoming release - Q2 2011. I hope this is not too late for you. 

Regards, Julian Benkov
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Tags
Treeview
Asked by
erwin
Top achievements
Rank 1
Veteran
Iron
Answers by
Julian Benkov
Telerik team
erwin
Top achievements
Rank 1
Veteran
Iron
Share this question
or