Code snippet for reproducing the problem:
Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.SongsTableAdapter.Fill(Me.MusicCollectionDataSet.Songs)
Me.ArtistsTableAdapter.Fill(Me.MusicCollectionDataSet.Artists)
Me.AlbumsTableAdapter.Fill(Me.MusicCollectionDataSet.Albums)
AddHandler Me.RadTreeView1.NodeDataBound, AddressOf RadTreeView1_NodeDataBound
Me.RadTreeView1.DataSource = Me.ArtistsBindingSource
Me.RadTreeView1.DisplayMember = "ArtistName"
Me.RadTreeView1.ValueMember = "ArtistID"
Me.RadTreeView1.RelationBindings.Add(New RelationBinding(Me.AlbumsBindingSource, "AlbumName", "ArtistID", "ArtistID", "AlbumID"))
Me.RadTreeView1.RelationBindings.Add(New RelationBinding(Me.SongsBindingSource, "SongName", "AlbumID", "AlbumID", "SongID"))
Me.RadTreeView1.CheckBoxes = True
Me.RadTreeView1.AutoCheckChildNodes = True
Me.RadTreeView1.TriStateMode = True
Me.RadTreeView1.ExpandAll()
End Sub
Private Sub RadTreeView1_NodeDataBound(sender As Object, e As RadTreeViewEventArgs)
If e.Node.Level = 0 Then
e.Node.CheckType = CheckType.None
Else
e.Node.CheckType = CheckType.CheckBox
End If
End Sub
Workaround: instead of using the NodeDataBound event, use the NodeFormatting event to hide the checkboxes for the desired nodes:
Private Sub RadTreeView1_NodeFormatting(sender As Object, e As TreeNodeFormattingEventArgs)
If e.Node.Level = 0 Then
e.NodeElement.ToggleElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed
Else
e.NodeElement.ToggleElement.Visibility = Telerik.WinControls.ElementVisibility.Visible
End If
End Sub