Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
975
pulling value of data tree selected node
posted

I am using the datatree with a heirarchal data source and it is working great. I want to pull the value of the selected child and use this value as a parameter to pull data back and populate a gridview.

I have this working for already for a ultragrid but I am having a hard time trying to pull the value of the data tree. I am using the OnSelectionChanged="WebDataTree2_SelectionChanged" and I want to pull the selected value out in the WebDataTree2_SelectionChanged sub in the code behind.

I tried to follow the agent sample applications code but I could not follow what it was doing to get this to work.

Any help would be appreciated!

Parents
  • 33839
    Verified Answer
    posted

    Rydavis,

    I'm going to assume that you have single selection turned on.  In that case, you can get the selected node from the first item in the Selected Nodes collection.  In your handler, you can get the node as follows.

            Dim node As DataTreeNode
            node = e.NewSelectedNodes(0)

    From there, you can get Node.Value, Node.Text, or Node.CheckState, among other things.  Hope this is what you're looking for.

     

    regards,
    David Young

Reply Children
No Data