0

hi! how can i populate a treeview with this:

ObservableCollection<ProjectTreeview> trvProject = new ObservableCollection<ProjectTreeview>()
{
	new ProjectTreeview(){ID=1, ParentID=0, Type="P", Name="Project Name"},
	new ProjectTreeview(){ID=2, ParentID=1, Type="F", Name="Field 1"},
	new ProjectTreeview(){ID=3, ParentID=1, Type="F", Name="Field 2"},
	new ProjectTreeview(){ID=4, ParentID=2, Type="S", Name="Structure A"},
	new ProjectTreeview(){ID=5, ParentID=3, Type="S", Name="Structure B"},
	new ProjectTreeview(){ID=6, ParentID=4, Type="C", Name="Component A1"},
	new ProjectTreeview(){ID=7, ParentID=5, Type="C", Name="Component B1"},
	new ProjectTreeview(){ID=8, ParentID=6, Type="CA1", Name="Component A2"},
	new ProjectTreeview(){ID=9, ParentID=7, Type="CB1", Name="Component B2"}
};

The heirarchy is based on the ParentID. Thanks :)

2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by abelLazm
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.