José Miguel
Top achievements
Rank 1
José Miguel
asked on 26 Jun 2009, 06:27 PM
I have a menu in an MDI form and I want to Disable some submenu options, How can I do that?.
Which is the equivalent in RadControls to his line of code?:
foreach (ToolStripMenuItem mnuitOpcion in this.menuStrip1.Items)
Greetings,
José Gutiérrez
Which is the equivalent in RadControls to his line of code?:
foreach (ToolStripMenuItem mnuitOpcion in this.menuStrip1.Items)
Greetings,
José Gutiérrez
4 Answers, 1 is accepted
0
Hi Jose Miguel,
In case you are using RadMenu, the code looks like this:
If you want to loop through all menu items in the hierarchy you can write a method similar to the one below:
I hope this helps. If you have additional questions, feel free to contact me.
All the best,
Victor
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
In case you are using RadMenu, the code looks like this:
foreach(RadMenuItem item in this.radMenu1.Items) |
{ |
// Do something with the items. |
} |
If you want to loop through all menu items in the hierarchy you can write a method similar to the one below:
void TraverseMenuItems(RadItemCollection items) |
{ |
foreach (RadItem item in items) |
{ |
if (item is RadMenuItem) |
{ |
RadMenuItem menuItem = (RadMenuItem)item; |
// Do something with menu item |
// Drill down to child items. |
TraverseMenuItems(menuItem.Items); |
} |
} |
} |
I hope this helps. If you have additional questions, feel free to contact me.
All the best,
Victor
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
José Miguel
Top achievements
Rank 1
answered on 02 Jul 2009, 04:48 AM
Finally it worked, thank you so much.
José Gutiérrez.
José Gutiérrez.
0
Manesh
Top achievements
Rank 2
answered on 07 Jul 2012, 09:51 AM
hey buddy, you have shown the loop and it worked well but if the menu items are more and if we made some of them visible false then then menu items were not rearranged as in the image
0
Your question has already been answered in the other thread you have asked it in. Please, see our answer there for more information.
We kindly ask you to use just one support channel to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two or more tickets instead of one. Moreover threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.
All the best,
Stefan
the Telerik team
We kindly ask you to use just one support channel to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two or more tickets instead of one. Moreover threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.
All the best,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>