UltraWebMenu_MenuItemClicked and know what was clicked . . . . but only for top level and 1 level down menus . . .
why doesn't UltraWebMenu_MenuItemClicked fire for
-sub -sub (flyout) menu selections ????
Thx,
XPXJ
Infragistics35.WebUI.UltraWebNavigator.v8.3, Version=8.3.20083.1009
HI ,
My Client-Size Item_click event fires for all levels. The ItemId of the ItemClick event has the full path of the menu index appended to it.
You can also get the level number by using the MenuItems getLevel method. You can also use the getText method to get the menu text.
Here is the code to my aspx page: (I tested clr 3.5 as well)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Infragistics2.WebUI.UltraWebNavigator.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.WebUI.UltraWebNavigator" TagPrefix="ignav" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title>
<script type="text/javascript" id="igClientScript"><!--
function UltraWebMenu1_ItemClick(menuId, itemId){ //Add code to handle your event here. debugger; alert(itemId); var item = igmenu_getItemById(itemId); alert(item.getLevel());
}// --></script></head><body> <form id="form1" runat="server"> <div> <ignav:UltraWebMenu ID="UltraWebMenu1" runat="server" JavaScriptFilename="" JavaScriptFileNameCommon="" WebMenuTarget="VerticalMenu"> <IslandStyle BackColor="LightGray" BorderStyle="Outset" BorderWidth="1px" Cursor="Default"> </IslandStyle> <HoverItemStyle BackColor="DarkBlue" Cursor="Default" ForeColor="White"> </HoverItemStyle> <Images> <SubMenuImage Url="ig_menuTri.gif" /> </Images> <ItemStyle Cursor="Default"> <Padding Left="0px" /> </ItemStyle> <Items> <ignav:Item Text="Top Item"> <Items> <ignav:Item Text="Sub Menu Item"> </ignav:Item> <ignav:Item Text="Sub Menu Item"> <Items> <ignav:Item Text="policy"> </ignav:Item> <ignav:Item Text="Sub Menu Item"> </ignav:Item> <ignav:Item Text="Sub Menu Item"> </ignav:Item> <ignav:Item Text="Sub Menu Item"> </ignav:Item> </Items> </ignav:Item> <ignav:Item Text="Sub Menu Item"> </ignav:Item> </Items> </ignav:Item> <ignav:Item Text="Top Item"> <Items> <ignav:Item Text="Sub Menu Item"> </ignav:Item> <ignav:Item Text="Sub Menu Item"> </ignav:Item> </Items> </ignav:Item> <ignav:Item Text="Top Item"> <Items> <ignav:Item Text="Sub Menu Item"> </ignav:Item> <ignav:Item Text="Sub Menu Item"> </ignav:Item> </Items> </ignav:Item> </Items> <DisabledStyle Font-Names="MS Sans Serif" Font-Size="8pt" ForeColor="Gray"> </DisabledStyle> <Levels> <ignav:Level Index="0" /> <ignav:Level Index="1" /> <ignav:Level Index="2" /> </Levels> <SeparatorStyle BackgroundImage="ig_menuSep.gif" CssClass="SeparatorClass" CustomRules="background-repeat:repeat-x; " /><ExpandEffects ShadowColor="LightGray"></ExpandEffects>
<MenuClientSideEvents ItemClick="UltraWebMenu1_ItemClick"></MenuClientSideEvents> <ParentItemStyle> <Padding Left="0px" Right="10px" /> </ParentItemStyle> </ignav:UltraWebMenu> </div> </form></body></html>
Dear MTraynor,
When trying to run your sample I get the following error (What assembly am I missing? I already have
Infragistics35.WebUI.Shared.v8.3, Infragistics35.WebUI.UltraWebNavigator.v8.3):
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0234: The type or namespace name 'Style' does not exist in the namespace 'Infragistics.WebUI.Shared' (are you missing an assembly reference?)Source Error:
Line 234: Line 235: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 236: private void @__BuildControl__control3(Infragistics.WebUI.Shared.Style @__ctrl) { Line 237: Line 238: #line 30 "C:\PMJ - 02-11-09\INFRAGISTICS - 02-11-09\UltraWebMenu - 02-25-09\MTraynor - 03-02-09\MTraynor\Default.aspx"
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\23a5c553\2b8bb871\App_Web_default.aspx.cdcab7d2.wus_qo0b.0.cs Line: 236
HI,
you added our clr 3.5 assemblies and the page's register tag is pointing to our clr 2.0 assemblies.
so either change the register tag to point to our 3.5 assemblies or add 2.0 assemblies.
Thanks you
I mostly work in 3.5 now.
This is what I have . . .
(I even copied the Register from a working app as you can see but still get error). ??
<%
--<%@ Register Assembly="Infragistics35.WebUI.UltraWebNavigator.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
Namespace="Infragistics.WebUI.UltraWebNavigator" TagPrefix="ignav" %>
--
%>
="Infragistics.WebUI.UltraWebNavigator"
?????
HI, your webconfig is probably missing the assemblies. A quick way to fix this issue is to create a new page and drop a webmenu onto the form, this will update your web.config file. Or just drop a webmenu onto the form you are working on.
Your web.config should look like this: (*this is the release version of 8.3 clr 3.5*)
<add assembly="Infragistics35.WebUI.UltraWebNavigator.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB"/> <add assembly="Infragistics35.WebUI.Shared.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7DD5C3163F2CD0CB"/>
Thanks this solved an issue I encountered