Unable to set the tree view node properties on server side click event

2 posts, 0 answers
  1. Pena
    Pena avatar
    4 posts
    Member since:
    Jun 2011

    Posted 26 Jul 2011 Link to this post


    I have  a treeview with parent node and child nodes. When clicked on any node, I need to have that node of the treeview expanded and clicked node to be disabled. The code below did not work.. I have tried setting a forecolor property to distinguish clicked node but that did not work either. Thanks for your help.  


    Public Sub RadTreeView1_NodeClick1(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles RadTreeView1.NodeClick
            e.Node.Expanded = True
            e.Node.Enabled = False
            'e.Node.ForeColor = Drawing.Color.Aqua
            If (e.Node.Value > 9000) Then
                Session("Page1ToNavigate") = e.Node.Text
                Session("Page2ToNavigate") = e.Node.Value
            End If
        End Sub





    <telerik:RadPanelItem Text="Company View" Expanded="false" Font-Bold="true">
                                               <telerik:RadPanelItem >
                               <telerik:RadTreeView ID="RadTreeView1" runat="server" DataSourceID="SqlDataSource4"
                                                           DataFieldID="UserID" DataFieldParentID="ParentID" DataValueField="UserID"
                                                           DataTextField="DisplayName" Skin="Outlook" >
  2. Plamen
    Plamen avatar
    3031 posts

    Posted 28 Jul 2011 Link to this post

    Hello Pena,

    You may try to add the NodeClick event inline like in this sample project that worked at my side.

    Hope this will be helpful.

    Kind regards,
    Plamen Zdravkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top