Hi
The idea is this: based on a dataset generated a tree structure but I found the following issues
1 - There is not a unique Key property by item or node... or is the property "Name"?
2 - Using the name property FindName method seems not to work ... so for items already included, this method always returns "Nothing" and the item is again included.
This process is generated immediately to the constructor of the class or window, ie, in the Sub Main exite a method that executes the code...
For Each currentRow As DataRow In myDataset.Tables(0).Rows
Dim currentItem As New RadTreeViewItem
With currentItem
.Header = currentRow("ObjectName").ToString.ToUpper.Trim
.IsEditable = False
.IsEnabled = True
.Name = .Header
End With
Dim myObject As RadTreeViewItem = Me.ObjectTypeTree.FindName(currentRow("ObjectName").ToString.ToUpper.Trim)
If myObject Is Nothing Then
Me.ObjectTypeTree.Items.Add(currentItem)
End If
currentItem = Nothing
myObject = Nothing
Next
So how I can solve the case described in items 1 and 2.
In advance, thank you all ....
The idea is this: based on a dataset generated a tree structure but I found the following issues
1 - There is not a unique Key property by item or node... or is the property "Name"?
2 - Using the name property FindName method seems not to work ... so for items already included, this method always returns "Nothing" and the item is again included.
This process is generated immediately to the constructor of the class or window, ie, in the Sub Main exite a method that executes the code...
For Each currentRow As DataRow In myDataset.Tables(0).Rows
Dim currentItem As New RadTreeViewItem
With currentItem
.Header = currentRow("ObjectName").ToString.ToUpper.Trim
.IsEditable = False
.IsEnabled = True
.Name = .Header
End With
Dim myObject As RadTreeViewItem = Me.ObjectTypeTree.FindName(currentRow("ObjectName").ToString.ToUpper.Trim)
If myObject Is Nothing Then
Me.ObjectTypeTree.Items.Add(currentItem)
End If
currentItem = Nothing
myObject = Nothing
Next
So how I can solve the case described in items 1 and 2.
In advance, thank you all ....