I would like to databind my TreeView from a data structure. After googling some, I came to a conclusion that writing my own simple Tree structure using List of Nodes would be the thing to do. However, I would like to know whether I am on the right path and not overdoing it - from what I know there is no Tree structure in c#.
What are the preferable methods to bind a TreeView to the data? (dynamic of course). Can I do something like:
List<node> nodes = new List<Node>();
//populate the nodes object
myTree.DataSource = nodes;
that would be ideal....Has anyone had any luck binding the tree to an actual object? From what i know so far, i would have to manually add TreeNode nodes to the tree and populate them from my nodes list, which is fine, but if there is an easier way, that would be better.
Thanks!