I want to bind each node of the tree with its type.
I am getting data into the data table.
For binding text we have DataTextField, for Id we have DataValueField,....
Is there any chance to bind the type of the node.
3 Answers, 1 is accepted
0
Atanas Korchev
Telerik team
answered on 30 May 2008, 11:25 AM
Hi Kousalya,
I am not sure what you mean by "type of the node". Anyway you can use the NodeDataBound event to map additional database fields to RadTreeNode properties. Please check this help topic for more info.
I have a rad tree view showing country , state , city and buildings.
I am binding the treeview in page load by using data table
Tree..DataFieldParentID =
"ParentID";
Tree.DataFieldID =
"NodeID";
Tree.DataTextField =
"Name";
Tree.DataValueField =
"ID";
I want to distiguish the node type such as whether it is a country type node or state type node or city type node or building type node.
In the data table i have a column called TYPE which specifies whether the record is country or state or city........................
How to bind this TYPE for each node of the treeview
0
Atanas Korchev
Telerik team
answered on 30 May 2008, 12:20 PM
Hi Kousalya,
You need to use the NodeDataBound event (see my previous reply for a link to the help topic). You can map the value of the Type column to some property of the treenode e.g. Category.