0

I need to know the selected node's parent node text from a ASP.NET Treeview on client side.

Is there anyway to know this?

Thank you!

1 Answer 1

1

Finally it is solved -

function GetSelectedNode() {
            var treeViewData = window["<%=treeView.ClientID%>" + "_Data"];
            if (treeViewData.selectedNodeID.value != "") {
                var selectedNode = document.getElementById(treeViewData.selectedNodeID.value);
                var ParentNode = selectedNode.parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling.innerText;
            }
            return ParentNode;
        }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.