On Aug 27, 10:14*am, Sathish Kumar wrote:
Anyone have idea how to build a configurable menu control. The menu itemsmust be read from XML or from the database & the items must be built. Options must be provided for generating horizontal or vertical menu. Any idea would be helpful.
Hi,
Of course, it's simple in fact.
declare your XML file, the horizontal/vertical can be an attribute of
the top tag.
then each subitem is a menu entry, basically all you need is the text,
and the action. The action part is the tricky one though. What I did
(it was for a toolbar but must be the same) is define an
interface ,IToolbarCommand with one method Execute() . in the Tag
property of the menu item you store the name of the class that takes
care of that action, then when selected you instantiate that class,
cast it to your interface and execute it.
Hope to be clear enough, if not post back and I will post some code