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

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

1 Answer 19 Views
This is a migrated thread and some comments may be shown as answers.
Pena
Top achievements
Rank 1
Pena asked on 26 Jul 2011, 07:45 PM
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>

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 28 Jul 2011, 03:23 PM
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.

Asked by
Pena
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or