Hi there,
I'm having difficulty figuring out how to bind my data ( ObservableCollection(of) ) and to display it as a hierarchy using vb.
I have the following example data, similar to your C# example I saw in another post called Treelistview-Self-Hierarchy.
** Please note again that the above is an ObservableCollection(Of ) list.
I have the following XAML List view.
I then set the ItemsSource in VB:
This displays all the information correctly in grid. However I need to group the items according to it's hierarchy.How can I achieve this with the minimal of fuss?
** Please note I am a newbie! **
Out of interest, the hierachy in my SQL 2008 database uses the new hierarchyid data type. Can the TreeListView use the hierarchyid data directly to generate the tree nodes?
I'm having difficulty figuring out how to bind my data ( ObservableCollection(of) ) and to display it as a hierarchy using vb.
I have the following example data, similar to your C# example I saw in another post called Treelistview-Self-Hierarchy.
ID Name ParentID
1 John NULL ** Top level node **
2 Chris 1 ** Parent is John **
3 Simon NULL ** Top level node **
4 Dave 1 ** parent is John **
5 Joe 3 ** parent is simon **
** Please note again that the above is an ObservableCollection(Of ) list.
I have the following XAML List view.
<
telerik:RadTreeListView
x:Name
=
"ParksTreeListView"
AutoGenerateColumns
=
"False"
IsFilteringAllowed
=
"True"
IsBusy
=
"False"
>
<
telerik:RadTreeListView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ID}"
Header
=
"ID"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Name}"
Header
=
"Name"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ParentID}"
Header
=
"Parent"
/>
</
telerik:RadTreeListView.Columns
>
</
telerik:RadTreeListView
>
I then set the ItemsSource in VB:
'Get parks information from SQL database
Dim
parksList
As
ObservableCollection(Of ParksTree) = ParksDB.GetAllParks()
'Set Tree items source
ParksTreeListView.ItemsSource = parksList
This displays all the information correctly in grid. However I need to group the items according to it's hierarchy.How can I achieve this with the minimal of fuss?
** Please note I am a newbie! **
Out of interest, the hierachy in my SQL 2008 database uses the new hierarchyid data type. Can the TreeListView use the hierarchyid data directly to generate the tree nodes?