Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create menu dynamically from a table
Message
From
07/08/2004 17:13:09
 
 
To
07/08/2004 16:50:03
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00931579
Message ID:
00931583
Views:
21
Al,

Try building a menu on a form in the IDE. Then, switch to the code view of the form and see what .NET generates for your menu, menu items and click events ... this should give you an idea of what you need to do programmatically.

~~Bonnie


>Can someone please give me an example in C# that creates a menu whose definition (captions, submenus, actions, etc.) is stored in a table?
>
>I have a SYSMENU table with a column, OBJCODE, that specifies if the given row is a menu/submenu or an action to be carried out in the menu item's click method. I'd like to build the menu which may be different based on a user's access rights and roles. In my attempt, I didn't get very far being very new to C#. I created a dataset with all the rows from SYSMENU and then, for each DataRow, I use a switch to determine what type of menuitem I want to create - that's as far as I got. I don't know how to define a variable number of menu items nor do I know how to add a variable menu range for submenus nor define a new click method "on the fly" for menu items that need to perform an action.
>
>Any help is appreciated! Thanks,
>Al
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform