On our B2B site, one of the design requirements is that the menu item that corresponds to the active page have a different style applied to it. The purpose is to give the page sort of a tab feel, without actually using a tab control.
We currently employ the Microsoft menu control, and I use the FindControl() to match the menu id with the page name and set .Selected to true and it applies the "selected" css to the menu item for the active page.
I'd like to reproduce that behavior, but using the infragistics menu control.
I'm a bit new to using the suite, and I don't see a way to do this.
Using the information found at http://forums.infragistics.com/forums/p/2335/15443.aspx#15443, I can find the menu item corresponding to the active page but how do I set it to a "selected state"? I'm doing the search for the menu item during the page_load event.
Hello,
Thanks for writing. Once you obtain a reference to the server side instance of the item, you can just create a new selected css style, for example:
<style type="text/css"> .selectedItem { color: red; font-weight:bold; } </style>
and then set the Item.CssClass = "selectedItem"
Please, let me know if this is applicable in your scenario.
Thank you for the reply. It worked as expected.
(refering to the code in the other thread) In my code, .GetItemFromID() was returning a null, but .Find() worked
Item miActiveTopic = uwmTopNavigation.Find(pagename); if (miActiveTopic != null) { miActiveTopic.CssClass = "igmn_LifeClinicTopSelected"; }
In my menu aspx code, I set the Tag property to the page name. Also, I drilled down into my style set's css file for the menu control and refered to that so I can use ApStylist for the design aspect.