0

in my asp.net treeview if i click one parent node then it should be extended if i click again on that node it should be collapsed in treeview... is any javascript availabe for this? or any code in selected node changed?

1 Answer 1

2

There's some information here about enabling the expand/collapse on the client. See the Enabling Client Script section.

Basically you need to set EnableClientScript to true for the control.

TreeView1.EnableClientScript = true;

Or

<asp:treeview id="..." runat="server" EnableClientScript="true" ... />
Sign up to request clarification or add additional context in comments.

5 Comments

is it enough for extend and collapse for same parent by clicking on that...or any javascript?
when i click on that parent node it could expanded but if i again click on that parent it didnt collapse why?
have you looked to see if there is a javascript error occuring? Is there some javascript you've written that could be interfering?
can u provide any javascript for this?
EnableClientScript will add the javascript you need. If that's not working you need to investigate why it's not working. Is your browser reporting an error?

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.