|
-
Feb 27th, 2004, 03:14 AM
#1
Thread Starter
Hyperactive Member
Fill Treeview
Hi group,
I need to fill a treeview in a C# winform app with nodes (root, childs, sibblings…)
I’ve got a table with these fields:
ChildID (number) Primary Key
Item (text)
ParentID (number)
Here’s some example data:
ChildID Item ParentID
1 Item 1 0
2 Item 1.1 1
3 Item 1.1.1 2
4 Item 1.2 1
5 Item 2 0
6 Item 2.1 5
I need to create a tree like this:
ROOT
- Item 1
o Item 1.1
§ Item 1.1.1
o Item 1.2
- Item 2
o Item 2.1
I know how I can add nodes childs and sibbling to a treeview but how do I create something (array, DataReader, whatever) to build the above?!
TIA
SD
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|