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

Saving and restoring state of TreeView checkboxes

1 Answer 61 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
marksweat
Top achievements
Rank 1
marksweat asked on 28 Mar 2017, 12:28 AM

My app has a TreeView with tristate checkboxes. The state is stored in a database. I'm wondering about the best way to save and restore state for parent nodes that are Indeterminate.

If I simply save the collection of nodes I get from the treeview.Checked method and restore the same nodes (as checked), the TreeView doesn't end up looking like the original state. Parent nodes that are indeterminate are restored as Checked and all their children are restored as checked.

Do I need to go through the Checked nodes and remove the ones that are indeterminate for storage? This seems to work differently in the current version of the TreeView than it did in a version from a few years back.

--Mark

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 31 Mar 2017, 06:31 AM
Hi Mark,

Have you tried making avail of RadPersistenceFramework for this scenario?
https://demos.telerik.com/aspnet-ajax/treeview/examples/applicationscenarios/persisting-treeview-settings/defaultcs.aspx?product=persistenceframework
http://demos.telerik.com/aspnet-ajax/persistence-framework/examples/overview/defaultcs.aspx

Regards,
Eyup
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
TreeView
Asked by
marksweat
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or