Home - Forums-.NET - FlyTreeView (ASP.NET) - Display Multiple Data Fields on one FlyTreeNode

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

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

Display Multiple Data Fields on one FlyTreeNode
Link Posted: 29-Jan-2007 03:25
Is it possible to display say the value and text fields from the datasource on a flytreenode.  (I.E. \"Value: Text\")
Link Posted: 29-Jan-2007 06:46
So do you simply need to display within the Text property of FlyTreeNode the \"Value: Text\"?

Did you achieve to bind the treenode to the \"Text\"? If yes, then you can simple handle NodeDataBound event to modify the FlyTreeNode.Text property according to your need.
Link Posted: 29-Jan-2007 21:59
Not quite,

I have a database that contains 2 values, a code and a description, and I would like to bind both the code and description fields to a node's text property if possible.
Link Posted: 30-Jan-2007 00:17
Yes, then you need to handle FlyTreeView.NodeDataBound event and then

string val1 = DataBinder.Eval(e.Node.DataItem, \"YourColumn1\");
string val2 = DataBinder.Eval(e.Node.DataItem, \"YourColumn2\");

e.Node.Text  = string.Format(\"{0}: {1}\", val1, val2);


Or something like this. I didn't test the code.
Link Posted: 30-Jan-2007 00:47
Many Thanks,
that works fine.