Home - Forums-.NET - FlyTreeView (ASP.NET) - Adding data items to child nodes

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Adding data items to child nodes
Link Posted: 28-Mar-2007 09:57
Any node binding has Depth (node level) and DataMember (tag name for XML datasource) attributes, that let you to enable criteria for data item.
You can combine these criteria and order in which you place node bindings to get required behavior.


Most of cases can be solved using these two attributes.
Any other advanced cases can be solved by using FlyTreeView.NodeDataBound event. It lets you handle every node bound and added to treeview, so that you can manually assign all node properties having DataItem supplied as event arguments. But this is for complex cases.

I believe that your one has a simpler solution.
Link Posted: 28-Mar-2007 10:09
[quote="EvgenyT"]Any node binding has Depth (node level) and DataMember (tag name for XML datasource) attributes, that let you to enable criteria for data item.
You can combine these criteria and order in which you place node bindings to get required behavior.


Most of cases can be solved using these two attributes.
Any other advanced cases can be solved by using FlyTreeView.NodeDataBound event. It lets you handle every node bound and added to treeview, so that you can manually assign all node properties having DataItem supplied as event arguments. But this is for complex cases.

I believe that your one has a simpler solution.


So you recommend using an XML file for this?

I plan to eventually have this code hooked up to a database but am hardcoding the values for now in order to get the logic in there first.
Link Posted: 28-Mar-2007 10:28
No, I do not recommend XML, just example.

FlyTreeView can be populated using a variety of methods.
You can use any of hierarchical datasources, convert tabular one to hierarchical presentation, use inline nodes (like in Demo_Office2003), or populate nodes programmatically (like in any example that loads nodes on demand).

You can also customize every step of databinding process by handling FlyTreeView.NodeDataBound event.

So the choice of nodes population depends on data you have to create nodes from.

Is it plain datatable? So just convert it to hierarchical datasource (as you did). And set FlyTreeView.DataBindings rules.

If DataBindings feature does not cover your case, then you can use FlyTreeView.NodeDataBound to set node properties in your custom way.