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

RadTreeView checkbox checked/unchecked on page_load

1 Answer 113 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joseph
Top achievements
Rank 1
Joseph asked on 16 Dec 2014, 11:25 PM
I was able to create a radtreeview using your example with checkboxes.  Now i need to check and uncheck certain values on first page load in vb.  Please advice.  Below is my code.  Thank You.

<div id="divMnuLeft">
   <telerik:RadTreeView ID="lstMenuItem1" CheckBoxes="true" TriStateCheckBoxes="true" CheckChildNodes="true" runat="server">
   <DataBindings>
          <telerik:RadTreeNodeBinding Expanded="true" />
   </DataBindings>
  </telerik:RadTreeView>
</div>
Private Sub Populate_tblMenuItems1()
        Dim dt As New DataTable
        Dim con As New clsSQLConnector
 
        dt = con.GetWebUserMenuItem(2, ViewState("WebUserID"))
        If dt Is Nothing = False Then
            If dt.Rows.Count > 0 Then
                lstMenuItem1.DataTextField = "Descr"
                lstMenuItem1.DataFieldID = "menuID"
                lstMenuItem1.DataFieldParentID = "ParentID"
                lstMenuItem1.DataSource = dt
                Dim binding As New RadTreeNodeBinding
                binding.CheckedField = "isAssigned"
                binding.Checkable = True
                lstMenuItem1.DataBindings.Add(binding)
                lstMenuItem1.DataBind()
                'For Each dr As DataRow In dt.Rows
                'Next
            End If
        End If
    End Sub

1 Answer, 1 is accepted

Sort by
0
Joseph
Top achievements
Rank 1
answered on 18 Dec 2014, 07:33 PM
Nevermind figured it out.
Tags
General Discussions
Asked by
Joseph
Top achievements
Rank 1
Answers by
Joseph
Top achievements
Rank 1
Share this question
or