This is a migrated thread and some comments may be shown as answers.

[Solved] Rad tree

3 Answers 137 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Kousalya
Top achievements
Rank 1
Kousalya asked on 30 May 2008, 10:14 AM
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

Sort by
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.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Kousalya
Top achievements
Rank 1
answered on 30 May 2008, 12:18 PM

Hi,

   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.

I hope this helps,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
Kousalya
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Kousalya
Top achievements
Rank 1
Share this question
or