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

NodeClick Event is not firing ?

1 Answer 57 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Madhu Palakurthi
Top achievements
Rank 1
Madhu Palakurthi asked on 10 Dec 2012, 09:13 AM
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..

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 12 Dec 2012, 01:54 PM
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.
Tags
TreeView
Asked by
Madhu Palakurthi
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or