Enabling Menu Toolstrip Items
Posted on 2007-11-14
I have a toolstrip that, by default, has a number of items disabled. I have a database table that defines different functionalities that a user is allowed in the application. Upon starting my application, I am reading that table, based on the UserName and returns a collection of permissible actions.
I am trying to figure out how to iterate through the collection and enable the appropriate menu items. I was thinking of associating the Tag of the individual menu items with the role, and iterating through the menu items for a tag that matches the role, but that seems like a lot of overhead. There will be different paths on the toolstrip that will be affected by this (for example, items under Tools, and subitems under those items, items under Reports, etc.
Some suggestions from the experts? I could map to the toolstrip item name, but that makes the data in the database table seem cryptic.