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

Retain treeview

3 Answers 49 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael
Top achievements
Rank 1
Michael asked on 30 Jan 2011, 07:07 PM
Hello,

Very new at this. 

I am using sitemap binding on the treeview, how do I retain the node that was selected after postback? Do I need to use ajax binding instead?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 30 Jan 2011, 07:55 PM
More searching yielded the following link which tells me how, but I'm unsure on the .BindTo property since I am using the sitemap.  My BindTo looks like this:

.BindTo(

"Web")

http://www.telerik.com/support/kb/aspnet-mvc/treeview/persisting-treeview-state-in-cookie.aspx

0
Michael
Top achievements
Rank 1
answered on 30 Jan 2011, 10:03 PM
I think I'm getting closer, but this isn't working:

.BindTo(

"Web", (item, siteMapNode) =>
{
item.Expanded = ((
string[])ViewData["ExpandedNodes"]).Contains(item.Text);
})

 


0
Georgi Krustev
Telerik team
answered on 02 Feb 2011, 01:29 PM
Hello Michael,

 
Could you please send us what your current implementation is? Thus we will review it locally and advice you further.

Regards,
Georgi Krustev
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
Tags
TreeView
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or