Hello:
I would like to get the parent and child values in ASPXTreeList and concatenate their values in order to get the URL of the form I want to access for example:
Users > Add New User
This one I could make it in the attached example, but in the case the node has children, I don ́t know how to get those values and concatenate them to form the complete URL like this:
Users > Assign > PC
> Notebook
> Mouse
I hope you can help me, Thanks
ASPxTreeList - How to get values of parent and child nodes
Answers approved by DevExpress Support
Hello,
Thank you for your update. I believe you can use the code from the E2157 - OBSOLETE: How to change the style of a parent node's selection checkbox if some of its child nodes are selected Code Central example to accomplish this task:
- Set the ASPxTreeList.SettingsBehavior.ProcessSelectionChangedOnServer property to "True";
- Handle the server-side ASPxTreeList.SelectionChanged;
- Iterate through nodes' collection;
- Save the required information in the Session state.
Thanks,
Mike
P.S. It seems you are using an older build of our components (according to the report's Build field). Please visit our Version Info Page to learn about the most recent versions of our products and obtain instructions on how to update them. In addition, check the What’s New list to learn more about newly introduced features and issues we have already resolved in the most recent version.
Hello,
I believe that you can use TreeListNodeIterator to iterate through child nodes and collect their values. Call the ASPxTreeList.CreateNodeIterator method to get the Iterator reference.
Best regards,
Vladimir
I modified my example and now I get the values of Parent, Child and GrandSon,I do it by clicking on buttons but now I want to save the values in session variables every time I select a node, without using those buttons, How can I do this? I need you to modify my ATTACHED PROJECT because I already checked your examples and I couldn't find an example like this, thanks.