Declined
Last Updated: 20 Jan 2020 12:09 by ADMIN
George
Created on: 14 Jan 2020 08:10
Category: TreeView
Type: Bug Report
0
RadTreeView: child nodes are not checked after expanding
Please use the following code snippet:    

 

Sub New()

        InitializeComponent()
        Me.RadTreeView1.Nodes.Clear()
        Me.RadTreeView1.CheckBoxes = True

        Dim node = New RadTreeNode("1") With {.CheckType = CheckType.CheckBox, .Checked = True, .CheckState = ToggleState.Indeterminate}
        RadTreeView1.Nodes.Add(node)
        node.Nodes.Add(New RadTreeNode("1.1") With {.CheckType = CheckType.RadioButton, .Checked = True, .CheckState = ToggleState.Indeterminate})
        node.Nodes.Add(New RadTreeNode("1.2") With {.CheckType = CheckType.RadioButton})
        node.Nodes.Add(New RadTreeNode("1.3") With {.CheckType = CheckType.RadioButton})
        node = New RadTreeNode("2") With {.CheckType = CheckType.CheckBox, .Checked = True, .CheckState = ToggleState.Indeterminate}
        RadTreeView1.Nodes.Add(node)
        RadTreeView1.Nodes.Add(New RadTreeNode("3"))

    End Sub

 

Workaround:

    Sub New()

        InitializeComponent()
        Me.RadTreeView1.Nodes.Clear()
        Me.RadTreeView1.CheckBoxes = True

        Dim node = New RadTreeNode("1") With {.CheckType = CheckType.CheckBox, .Checked = True, .CheckState = ToggleState.Indeterminate}
        RadTreeView1.Nodes.Add(node)
        node.Nodes.Add(New RadTreeNode("1.1") With {.CheckType = CheckType.RadioButton, .Checked = True, .CheckState = ToggleState.Indeterminate})
        node.Nodes.Add(New RadTreeNode("1.2") With {.CheckType = CheckType.RadioButton})
        node.Nodes.Add(New RadTreeNode("1.3") With {.CheckType = CheckType.RadioButton})
        node = New RadTreeNode("2") With {.CheckType = CheckType.CheckBox, .Checked = True, .CheckState = ToggleState.Indeterminate}
        RadTreeView1.Nodes.Add(node)
        RadTreeView1.Nodes.Add(New RadTreeNode("3"))


        Me.RadTreeView1.ExpandAll()
         
    End Sub

    Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.RadTreeView1.CollapseAll()

    End Sub

 

Attached Files:
1 comment
ADMIN
Dimitar
Posted on: 20 Jan 2020 12:09

Hello,

The sample code uses nodes with the CheckType property set to RadioButton. This type does not support the Indeterminate state. One should use the Indeterminate state with nodes having the CheckType property to CheckBox. In this case it is also necessary to set the TrisStateMode property of the tree to true.
 

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.