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

Read the Bound Data from the SelectedNode

1 Answer 19 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Greg Smith
Top achievements
Rank 1
Greg Smith asked on 07 Jan 2010, 01:10 PM
How do you access the Bound Data for the SelectedNode on the server side?

myTreeView.SelectedNode is set, but the DataItem value is NULL. When the user selects a node and does a post back I need the Identity value of the selected node, but I'm not sure how to access it.

Any help would be appreciated.


Thanks
Greg

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Jan 2010, 01:42 PM
Hello Greg,

You could set the 'DataValueField' as ID and access the ID value of SlectedNode using 'e.Node.Value' property.

If you want to access a third value from database, then you can make use of Custom Attributes, and access the attribute in NodeClick event. Checkout the following forum link which shows how to implement this.
Rad tree view :Binding custom attributes

-Shinu.
Tags
TreeView
Asked by
Greg Smith
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or