Tree-view with databinding

  • Thread starter Thread starter Pete Smith
  • Start date Start date
P

Pete Smith

Hi,

what's best practice to bind data to tree-view control?

Thanks for any advice in advance

Pete
 
Doesn't exist in 1.1.

Here's one sample for wiring this up yourself:

http://www.eggheadcafe.com/articles/treeview_databinding.asp

This works well in a single table hierarchy.

In a multi-table hierarchy, it is pretty tough to
create a reusable solution.

In 2.0 (you could to something similar in 1.1 without generics),
I like to create separate generic lists of classes for each table.
Then, perform hunts for parent/children by property and
sort by property. I only keep a class with the ID,
Description, and ClassName of the generic item I
want in the TreeNode.Tag

Whenever a node is clicked, I figured out what kind
of class it would be and which generic list it would
have been associated with and query it using
a delegrate.

This can help you get started with that:

http://www.eggheadcafe.com/articles/dotnet_generics_class_property_sort.asp
 
For a commercel tree control that provides a very flexible databinding
model (including binding to data from multiple ADO.NET tables) take a
look at Infralution's Virtual Tree. You can get more information and a
fully functional evaluation version at:

www.infralution.com/virtualtree.html

Regards
Grant Frisken
Infralution
 
Back
Top