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

RadTreeView ViewState issue when binding different dataset

2 Answers 35 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ken Jones
Top achievements
Rank 1
Ken Jones asked on 17 Jun 2010, 11:32 AM
Hello,

We are using a the RadTreeView control inside a master page that populates data in a content page via a redirect on node click. The problem is that we are binding a different dataset to the tree on page load and then expanding the tree to the node that was clicked. This is causing the nodes in the tree that we have expanded to show the collapsed icon even though they are expanded.

When we then click the icon to expand the node it initially does nothing, click again and it attempts to expand the node and click again and ti successfully collaps the node.

Here is the nodes onclick event to give you some idea:

protected void uiRadTreeView_NodeClick(Object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)  
        {  
            // Set the session variable search to be null so no highlighting occurs in PopulateContentPane  
            Session["Search"] = null;  
 
            string siteId = Request.QueryString["SiteId"];  
            if (!String.IsNullOrEmpty(siteId))  
            {  
                Users user = (Users)Session["User"];  
                if (user == null)  
                {  
                    user = new Users(Page.User.Identity.Name);  
                }  
 
                // Log action  
                AuditLog.AddEntry(user, TLT.Extranet.DataAccess.Site.Type.General, 3, Int32.Parse(siteId), Int32.Parse(e.Node.Value), Session.SessionID);  
                Response.Redirect("Default.aspx?SiteId=" + siteId + "&NodeId=" + e.Node.Value);  
            }  
        } 

Any help to solve this would be much appreciated,

Thanks,

Ken

2 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 22 Jun 2010, 11:09 AM
Hi Ken Jones,

This is only the Node_Click handler. Could you please post the code for the initial binding and the code that is triggered on NodeExpand?
Thanks!


Regards,
Nikolay Tsenkov
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
0
Ken Jones
Top achievements
Rank 1
answered on 22 Jun 2010, 03:28 PM
Hello,

Thanks for your response. I have managed to sort this out by setting the ExpandMode property of the Nodes back to ClientSide once the data is bound to the tree.

Thanks,

Ken
Tags
TreeView
Asked by
Ken Jones
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Ken Jones
Top achievements
Rank 1
Share this question
or