NodeClick Event is not firing ?

2 posts, 0 answers
  1. Madhu Palakurthi
    Madhu Palakurthi avatar
    48 posts
    Member since:
    Nov 2009

    Posted 10 Dec 2012 Link to this post

    Hi,

    I have added treeview in my aspx page like this..
      <asp:TableCell CssClass="dfv">
       <telerik:RadTreeView ID="tvChkSearchResult" runat="server" OnNodeClick="tvChkSearchResult_NodeClick"
        AutoPostBack="True" Width="300px" Height="200px" CheckBoxes="True" TriStateCheckBoxes="true"
     CheckChildNodes="true">
      </telerik:RadTreeView>
    </asp:TableCell>

    and binding here ...
    Dim siteData As New List(Of TreeViewCheckbox)()
                If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
                    siteData.Add(New TreeViewCheckbox(1, 0, "Select All"))
     
                    Dim i As Integer = 0
                    Do While (i < dt.Rows.Count)
                        Dim row As DataRow = dt.Rows(i)
                        Dim srColumn As String = row(searchedColumn)
                        i = (i + 1)
                        siteData.Add(New TreeViewCheckbox(i + 1, 1, srColumn))
                    Loop
                End If
     
                If Not String.IsNullOrEmpty(EditValue) Then
                    siteData.Add(New TreeViewCheckbox(1, 0, "Select All"))
                    siteData.Add(New TreeViewCheckbox(2, 1, EditValue.Trim()))
                End If
     
                tvChkSearchResult.DataTextField = "Text"
                tvChkSearchResult.DataFieldID = "ID"
                tvChkSearchResult.DataFieldParentID = "ParentID"
                tvChkSearchResult.DataSource = siteData
                tvChkSearchResult.DataBind()


    Now I would like to fill up values in to textboxes that is based on selection on treeview.

    but these events are not firing..

    Protected Sub tvChkSearchResult_NodeCheck(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles tvChkSearchResult.NodeCheck
           If tvChkSearchResult.SelectedNode.Checked Then
               Dim s As String = ""
           End If
       End Sub
     
       Protected Sub tvChkSearchResult_NodeClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles tvChkSearchResult.NodeClick
           If tvChkSearchResult.SelectedNode.Checked Then
               Dim s As String = ""
           End If
       End Sub

    Please help me on how to fire events ?

    Thanks in advance..
  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 12 Dec 2012 Link to this post

    Hello,

    Please find attached a project that demonstrates how you can keep tack of both server-side events NodeCheck and NodeClick execution. The label control indicates whether check or click event if fired.
    Please keep in mind using Visual Basic you can attach an event handler either from markup code or from code behind using the syntax Handles.


    Kind regards,
    Boyan Dimitrov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top