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
Thanks this solved an issue I encountered
OK. It took a new form to register the assembly in Web.Config. (just adding another UltraWebMenu ctl to page didn't). Am able to demonstrate all levels fire the ItemClick:
<
MenuClientSideEvents InitializeMenu="" ItemChecked="" ItemClick="CDBG_UltraWebMenu_ItemClick"
SubMenuDisplay="" ItemHover=""></MenuClientSideEvents>
What's happening I finally understand is the fly-out menu items are redirecting to a TargetUrl before
the Click event. And this is OK as it's actually better that we have come to a solution in which we are toggling visibility of ContentPlaceHolders in the MasterPage IN the <child>.aspx.vb rather in Master.vb (fewer files to modify when change is req'd). So all is well.
BTW: this new forum re-design is slick and all with swirly page titles of colored interstellar gas and all . . . but bottom line everything appears to take longer to respond.
Thank once again for all your help and assistance IG,
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"/>
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,
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