Is there a way to setup Access Keys in the WebDataMenu like we could in the UltraWebMenu?
Hello,
Just checking if the latest reply helped you out and if you require any further assistance on the matter.
Sincerely,DimiDeveloper Support Engineer, MCPD Infragistics, Inc.www.infragistics.com/support
Hiiii,
Please provide some sample code for this
I have webdatamenu, inside this i have 10 menu items and i want to assign accesskey for each menu item.
Thank You................
Hello all,
The code sample shows how to set accesskey to DataMenuItem and use it in key combination Alt + SomeKey. Attach Initialize client event to the WebDataMenu, and set the acceskey attribute to the DataMenuItems that you want. SetAttribute function is setting the accesskey attribute with value first letter of the DataMenuItems.function WebDataMenu1_Initialize(sender, eventArgs) { for (var i = 0; i < sender.getItems().get_length() ; i++) { var item = sender.getItems().getItem(i); if (item.get_text().length != 0) { item.get_element().setAttribute("accesskey", item.get_text().charAt(0)); }}It is tested in IE, Firefox and Chrome. To use the access key in Firefox you need to use Alt + Shift key combination (Alt + Shift + H), in the other browsers it is only with Alt key (Alt + H).
Can you please confirm what mistake I have made, as the suggested code is not working from me.
<Items>
<ig:DataMenuItem Key="Home" NavigateUrl="~/Default.aspx" Text="Home">/ig:DataMenuItem>
<ig:DataMenuItem Key="Reports" NavigateUrl="~/Reports.aspx" Text="Reports"></ig:DataMenuItem>
<ig:DataMenuItem Key="Admin" NavigateUrl="~/Administrator/Admin.aspx" Text="Admin"></ig:DataMenuItem>
</Items>
And My function is same as suggested by you
function WebDataMenu1_Initialize(sender, eventArgs) {
for (var i = 0; i < sender.getItems().get_length() ; i++)
{ var item = sender.getItems().getItem(i); if (item.get_text().length != 0) { item.get_element().setAttribute("accesskey", item.get_text().charAt(0)); } } }
I have attached this function WebDataMenu already
<ig:WebDataMenu ID="Some_ID" ClientEvents-Initialize= "WebDataMenu1_Initialize" ...>
Note :- I am using IE