Posted 30 December 2023, 6:09 pm EST - Updated 30 December 2023, 6:16 pm EST
In the following form with a treeview named tv and a button Button1:
Imports System.ComponentModel
Imports C1.Win.TreeView
Public Class Form1
Private root As New classData
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
tv.SuspendLayout()
root.children.Add(New classData)
Text = root.children.Count
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
tv.BindingInfo.DataSource = root.children
tv.BindingInfo.DataMember = "children"
tv.BindingInfo.BindingMode = BindingMode.TwoWay
End Sub
End Class
Public Class classData
Public Property children As New BindingList(Of classData)
End Class
When adding the second record.