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

    Hi,

    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
                Response.Redirect("~/Page1.aspx")
      
            Else
      
                Session("Page2ToNavigate") = e.Node.Value
                Response.Redirect("~/Page2.aspx")
      
            End If
        End Sub

     

     

     

     

    <telerik:RadPanelItem Text="Company View" Expanded="false" Font-Bold="true">
                                          <Items>
                                               <telerik:RadPanelItem >
                                                <ContentTemplate>
                               <telerik:RadTreeView ID="RadTreeView1" runat="server" DataSourceID="SqlDataSource4"
                                                           DataFieldID="UserID" DataFieldParentID="ParentID" DataValueField="UserID"
                                                           DataTextField="DisplayName" Skin="Outlook" >
                                                       </telerik:RadTreeView>
                           </ContentTemplate>
                                               </telerik:RadPanelItem>
  2. Plamen
    Admin
    Plamen avatar
    2968 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