Expand all sub menu nodes.

Posted by Nisar under ASP.NET on 2/22/2011 | Points: 10 | Views : 2904 | Status : [Member] | Replies : 10
Hi,

I am building a menu, it has main menu and sub menu. i want if i click on one node of main manu it should expand /show all sub menu nodes.

Thanks.




Responses

Posted by: Webmaster on: 2/22/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Are you using asp:TreeView? If yes, do not specify ExpandDepath property that will show all the nodes and sub nodes.

<asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapSource1"  />


Look at this tutorials for more http://www.dotnetfunda.com/tutorials/controls/treeview.aspx.

Hope this helps
Thanks

Best regards,
Webmaster
http://www.dotnetfunda.com

Nisar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nisar on: 2/22/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,
No i am not using treeview. I am using making dynamic horizantal menu.
for example
Main menu:- Node1 Node2 Node3
Sub menu:- Child1 Child2

Each node has child, Now when i click on any specific node i get his child on sub menu but i want when i click on any Node , all node's child should be populated on sub menu.

Thanks.



Nisar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/22/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Try like below

treeView1.ExpandAll();
//or
treeView1.CollapseAll();

Thanks
Karthik
www.f5Debug.net

Nisar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 2/23/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
nice one Karthik..that's the easy one.

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Nisar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nisar on: 2/23/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

I think you did not get my question.


Nisar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/23/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Ok then pls post your requirement clearly....

Thanks
Karthik
www.f5Debug.net

Nisar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 2/23/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Karthik, I think he's talking about Menu than the Tree structure....not sure....!!

Please post your req. clearly dude..


Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Nisar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/23/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
ok then we need to see which control he uses to bind the menu!!!

Thanks
Karthik
www.f5Debug.net

Nisar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 2/23/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Yup, exactly!!! :) let's see....

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Nisar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/23/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
ok sure!!!

Thanks
Karthik
www.f5Debug.net

Nisar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response