. Could you please provide me a code sample showing how to load a treelistview from database with hardcoded root nodes on treelistview.
I have shared the link below of a sample preview of the tree I am in need of. Rootnodes are hardcoded and I want the child nodes to be populated from a database.
http://tinypic.com/view.php?pic=qnr212&s=5#.Upl6WsSnrh0
Please shed some light here.
Thanks Rahul
To populate a
XtraTreeList
, you can simply do this :According to the child / parent relationship, when defining your class
UserDefiniedClass
, you have to add two public fields, which are :ID
andParentID
(which are of typeint
).When you build your list of objects, make sure that :
ID
for each recordID
as the child'sParentID
ParentID
field if the node does not have a parent.Hope that helps !