Read the Bound Data from the SelectedNode

2 posts, 0 answers
  1. Greg Smith
    Greg Smith avatar
    11 posts
    Member since:
    Sep 2009

    Posted 07 Jan 2010 Link to this post

    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.

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 07 Jan 2010 Link to this post

    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

Back to Top