I'm trying to incorporate the copyandpaste example on a page with a masterpage, and I'm thinking that is what's giving me all the grief. I get a message that says "popup menu name is not valid". I've tried some of the suggestions from this forum within other posts, but to no avail. I have tried different variations of the menu name and I get compile errors basically stating that the name I'm using doesn't exist. I did a response.write in the page.init to get the name of the popup menu, and this is what it gave me back ctl00_ContentPlaceHolder1_CopyPasteMenu
The masterpage has a contentplaceholder, and in the child page I placed the CopyPasteMenu within that control. Do I somehow have to reference the parent(masterpage), or should I put the CopyPasteMenu on the masterpage, and reference it that way? I've pasted my page source below, and if anyone needs more, I can post that as well.
Thanx,Mike
<%@ Register Assembly="Infragistics2.WebUI.WebDataInput.v7.3, Version=7.3.20073.1043, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
<%@ Register Assembly="Infragistics2.WebUI.WebCombo.v7.3, Version=7.3.20073.1043, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
<%@ Register Assembly="Infragistics2.WebUI.UltraWebGrid.v7.3, Version=7.3.20073.1043, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
<%@ Register Assembly="Infragistics2.WebUI.UltraWebNavigator.v7.3, Version=7.3.20073.1043, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
<%@ Register Assembly="Infragistics2.WebUI.Misc.v7.3, Version=7.3.20073.1043, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
<%@ Register Assembly="Infragistics2.WebUI.UltraWebToolbar.v7.3, Version=7.3.20073.1043, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
<%@ Register Src="~/Clipboard/Clipboard.ascx" TagName="Clipboard" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
//Firefox passes event arg as parameter (evt). If that is null, we'll use window.event (Internet Explorer proprietary)
//Call show menu with menuID
//specify clientX and clientY to get more accurate positioning for this particular layout
// igmenu_showMenu("<%=Me.CopyPasteMenu.ClientID %>",null,(e.clientX+document.documentElement.scrollLeft)+"px",(e.clientY+document.documentElement.scrollTop)+"px");
//Firefox (W3C) - cancel event
//InternetExplorer (Proprietary) - cancel event
}
function GridClick(grid,src,button){
//Because the WebGrid consumes all mouse events, we need to add
//a listener to determine when a mouse click has occured so we can
//close the popup menu appropriately
//function InsertRow() {
// var grid=igtbl_getGridById("CopyPasteGrid1");
// var row=grid.Rows.getRow(grid.Rows.length-1);
// row.remove();
// grid.Rows.insert(row,0);
//}
{
//Get the activerow
//if activerow exists then add a new row
else
//if no activerow then set one and add the row to the customers band
//Grab a reference to the ContextMenuItem that was clicked on
//We need to know which tab we're on, so we can figure out which
//grid we want to perform the copy/paste operation on.
//Notice we use the asp style tag to emit the ClientID of the tab.
//This makes our code more maintainable in the event that the tab
// curGrid="<%=Me.uwgListsEntered.ClientID %>";
//We'll use the text from the menuitem to decide which operation to perform
curGrid.cut();
break;
curGrid.copy();
curGrid.paste();
curGrid.insert();
case "Export To Excel":
</script>
<table id="tblAppLocation" style="width: 100%">
<tr>
<td style="width: 30%; font-weight: bold; color: white; background-image:url(../../Images/tab1024_red.gif); font-family: Tahoma; height: 21px; font-size: 8pt;">
List(s) Entered</td>
<td style="width: 70%; font-weight: bold; color: white; font-family: Tahoma; background-color: transparent; height: 21px; background-image: url(../../Images/tab1024_red.gif); background-repeat: repeat-y; overflow: visible;">
<asp:Label ID="lblProjectDescription" runat="server" Text="Label" BackColor="Transparent" Font-Bold="True" Font-Names="Tahoma" Font-Size="8pt" ForeColor="White"></asp:Label></td>
</tr>
<tr></tr>
</table>
<table id="tblMain" style="width: 100%; height: 100%">
<td style="width: 1386px">
<igtbar:ultrawebtoolbar id="uwtoolLOLMaintenance" runat="server" Font-Names="Tahoma" Font-Size="7pt" StyleSetName="RadioFlyer" StyleSetPath="~/App_Themes" EnableAppStyling="True" BackgroundImage="" ImageDirectory="" ItemWidthDefault="">
<igtbar:TBarButton DisabledImage="" HoverImage="" Image="~/Images/New.bmp" Key="tbtnNewRow"
<Images>
</Images>
<igtbar:TBarButton DisabledImage="" HoverImage="" Image="~/Images/Save.bmp"
<igtbar:TBarButton DisabledImage="" HoverImage="" Image="~/Images/Copy.bmp"
<igtbar:TBarButton DisabledImage="" HoverImage="" Image="~/Images/Mainframe.bmp"
<igtbar:TBarButton DisabledImage="" HoverImage="" Image="~/Images/Exit.bmp" Key="tbtnExit"
</igtbar:TBarButton>
</Items>
</igtbar:ultrawebtoolbar>
</td>
<td style="height: 21px; width: 1386px;">
<asp:Label ID="lblErrorMessage" runat="server" ForeColor="Red"></asp:Label>
<igmisc:WebGroupBox ID="wgbCopyFromProject" runat="server" EnableAppStyling="True"
Font-Bold="True" Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" StyleSetName="RadioFlyer"
<igcmbo:WebCombo ID="wcbCopyFromProject" runat="server" BackColor="White" BorderColor="Silver"
BorderStyle="Solid" BorderWidth="1px" Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black"
<Columns>
<header caption="ProjectNumber" key="ProjectNumber" title="ProjectNumber"></header>
<igtbl:UltraGridColumn>
<RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo>
<footer>
</footer>
</Columns>
<DropDownLayout BorderCollapse="Separate" RowHeightDefault="18px" Version="4.00">
<BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
<FrameStyle BackColor="Silver" BorderStyle="Ridge" BorderWidth="2px" Cursor="Default"
</FrameStyle>
<BorderDetails WidthLeft="0px" WidthTop="0px" />
<SelectedRowStyle BackColor="#C00000" ForeColor="White" />
<Rows>
<cells>
<igtbl:UltraGridCell Text="NSP208"></igtbl:UltraGridCell>
</igtbl:UltraGridRow>
</igcmbo:WebCombo>
<td style="width: 1386px;height: 50px;">
<igmisc:WebGroupBox ID="wgbColumnData" runat="server" EnableAppStyling="True"
Font-Bold="True" Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black"
<Template>
<igmisc:WebGroupBox ID="wgbColumn" runat="server" BorderColor="#C00000"
BorderWidth="1px" Font-Bold="False" Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black"
<igcmbo:WebCombo ID="wcbColumn" runat="server" BackColor="White" BorderColor="Silver"
BorderStyle="Solid" BorderWidth="1px" EnableAppStyling="True" Font-Bold="False" Font-Names="Tahoma"
Font-Size="8pt" ForeColor="Black" SelBackColor="192, 0, 0" SelForeColor="White" StyleSetName="RadioFlyer"
<header caption="Column0"></header>
<DropDownLayout BorderCollapse="Separate" RowHeightDefault="18px" Version="4.00" ColHeadersVisible="No">
"></igtbl:UltraGridCell>
</cells>
<igtbl:UltraGridRow Height="">
<igtbl:UltraGridCell Text="DOLLARS"></igtbl:UltraGridCell>
<igtbl:UltraGridCell Text="FREQUENCY"></igtbl:UltraGridCell>
<igtbl:UltraGridCell Text="KEYCODE"></igtbl:UltraGridCell>
<igtbl:UltraGridCell Text="MAJORSEGMENT"></igtbl:UltraGridCell>
<igtbl:UltraGridCell Text="PRIORITY"></igtbl:UltraGridCell>
<igtbl:UltraGridCell Text="RECENCY"></igtbl:UltraGridCell>
<igtbl:UltraGridCell Text="SEGMENTBREAK"></igtbl:UltraGridCell>
<igtbl:UltraGridCell Text="SUB-SEGMENT"></igtbl:UltraGridCell>
<igtbl:UltraGridCell Text="ZIPSEGMENTLOW"></igtbl:UltraGridCell>
</Template>
<td style="width: 100px; height: 25px">
<igmisc:WebGroupBox ID="wgbCellValue" runat="server" BorderColor="#C00000" BorderWidth="1px"
Font-Bold="False" Width="100px" Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" StyleSetName="RadioFlyer"
StyleSetPath="~/App_Themes" Text="Value:">
<igtxt:WebTextEdit ID="wteValue" runat="server" EnableAppStyling="True" Font-Bold="False"
Font-Names="Tahoma" Font-Size="8pt" MaxLength="255" StyleSetName="RadioFlyer" StyleSetPath="~/App_Themes" Width="95px" SelectionOnFocus="SelectAll">
</igtxt:WebTextEdit>
<td style="width: 65px; height: 25px">
<igmisc:WebGroupBox ID="wgbStartRow" runat="server" BorderColor="#C00000" BorderWidth="1px"
Font-Bold="False" Font-Names="Tahoma" ForeColor="Black" StyleSetName="RadioFlyer"
<igtxt:WebTextEdit ID="wteStartRow" runat="server" EnableAppStyling="True" MaxLength="7"
SelectionOnFocus="SelectAll" StyleSetName="RadioFlyer" StyleSetPath="~/App_Themes"
<igtxt:WebTextEdit ID="wteNumberOfRows" runat="server" EnableAppStyling="True" MaxLength="7"
<asp:CheckBox ID="chkAllRows" runat="server" Font-Bold="False" Font-Names="Tahoma"
<igmisc:WebGroupBox ID="wgbIncrementDecrementBy" runat="server" BorderColor="#C00000"
StyleSetName="RadioFlyer" StyleSetPath="~/App_Themes" Text="Increment/Decrement By:"
<igtxt:WebTextEdit ID="wteIncrementDecrementBy" runat="server" Width="45px" EnableAppStyling="True" StyleSetName="RadioFlyer" StyleSetPath="~/App_Themes">
<asp:RadioButtonList ID="rblIncrementDecrement" runat="server" Font-Names="Tahoma"
<asp:ListItem>Increment</asp:ListItem>
</asp:RadioButtonList>
<td style="width: 175px; height: 25px">
<igtbar:UltraWebToolbar ID="uwtoolOKCancel" runat="server" BackgroundImage="" EnableAppStyling="True"
ImageDirectory="" ItemWidthDefault="" StyleSetName="RadioFlyer" StyleSetPath="~/App_Themes">
<Items>
<igtbar:TBSeparator />
<igtbar:TBarButton DisabledImage="" HoverImage="" Image="~/Images/Checkmark-Green.bmp"
Key="OK" SelectedImage="" Tag="OK" Text="OK">
<DefaultImage Url="~/Images/Checkmark-Green.bmp" />
<igtbar:TBarButton DisabledImage="" HoverImage="" Image="~/Images/CancelX.bmp" Key="Cancel"
SelectedImage="" Tag="Cancel" Text="Cancel">
<DefaultImage Url="~/Images/CancelX.bmp" />
</igtbar:UltraWebToolbar>
<asp:CheckBox ID="chkDataToWorkSpace" runat="server" Font-Bold="True" Font-Names="Tahoma"
</template>
<igmisc:WebPanel ID="wpanWorkSpace" runat="server" EnableAppStyling="True" Expanded="False"
<PanelStyle Font-Names="Tahoma" Font-Size="8pt">
<Header Text="WorkSpace">
<Bands>
<AddNewRow View="NotSet" Visible="NotSet">
</igtbl:UltraGridBand>
<DisplayLayout AllowColSizingDefault="Free" AllowColumnMovingDefault="OnServer" AllowDeleteDefault="Yes"
AllowSortingDefault="OnClient" AllowUpdateDefault="Yes" BorderCollapseDefault="Separate"
HeaderClickActionDefault="SortMulti" Name="UltraWebGrid1" RowHeightDefault="20px"
RowSelectorsDefault="No" SelectTypeRowDefault="Extended" StationaryMargins="Header"
<GroupByBox>
</BoxStyle>
<GroupByRowStyleDefault BackColor="Control" BorderColor="Window">
<ActivationObject BorderColor="" BorderWidth="">
<FooterStyleDefault BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
<RowStyleDefault BackColor="Window" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
<BorderDetails ColorLeft="Window" ColorTop="Window" />
</RowStyleDefault>
<FilterOperandDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid"
BorderWidth="1px" CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif"
<Padding Left="2px" />
<FilterHighlightRowStyle BackColor="#151C55" ForeColor="White">
<FilterDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif" Font-Size="11px"
</FilterOptionsDefault>
<EditCellStyleDefault BorderStyle="None" BorderWidth="0px">
<FrameStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Microsoft Sans Serif" Font-Size="8.25pt" Height="200px"
<PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
</PagerStyle>
<AddNewBox Hidden="False">
</AddNewBox>
</igtbl:UltraWebGrid>
<td style="width: 1386px; height: 375px;">
<igtbl:UltraWebGrid ID="uwgListsEntered" runat="server" EnableAppStyling="True" StyleSetName="RadioFlyer" StyleSetPath="~/App_Themes" Width="100%" Height="384px">
<igtbl:UltraGridBand AllowRowNumbering="Continuous">
<igtbl:UltraGridColumn Key="ListID">
</Header>
<igtbl:UltraGridColumn Key="FamilyID">
<RowLayoutColumnInfo OriginX="1" />
<Footer>
</Footer>
<igtbl:UltraGridColumn Case="Upper" Key="Priority">
<RowLayoutColumnInfo OriginX="2" />
<igtbl:UltraGridColumn Case="Upper" Key="MajorSegment">
<RowLayoutColumnInfo OriginX="3" />
<igtbl:UltraGridColumn Case="Upper" Key="Sub-Segment">
<RowLayoutColumnInfo OriginX="4" />
<igtbl:UltraGridColumn Case="Upper" Key="Group">
<RowLayoutColumnInfo OriginX="5" />
<igtbl:UltraGridColumn Case="Upper" Key="Keycode">
<RowLayoutColumnInfo OriginX="6" />
<igtbl:UltraGridColumn Case="Upper" Key="Division">
<RowLayoutColumnInfo OriginX="7" />
<igtbl:UltraGridColumn Case="Upper" Key="Recency">
<RowLayoutColumnInfo OriginX="8" />
<igtbl:UltraGridColumn Case="Upper" Key="Select">
<RowLayoutColumnInfo OriginX="9" />
<igtbl:UltraGridColumn Case="Upper" Key="Frequency">
<RowLayoutColumnInfo OriginX="10" />
<igtbl:UltraGridColumn Case="Upper" Key="Dollars">
<RowLayoutColumnInfo OriginX="11" />
<igtbl:UltraGridColumn Case="Upper" Key="SegmentBreak">
<RowLayoutColumnInfo OriginX="12" />
<igtbl:UltraGridColumn Case="Upper" Key="RecordSource">
<RowLayoutColumnInfo OriginX="13" />
<igtbl:UltraGridColumn Case="Upper" Key="BrokerID">
<RowLayoutColumnInfo OriginX="14" />
<igtbl:UltraGridColumn Key="Quantity">
<RowLayoutColumnInfo OriginX="15" />
<igtbl:UltraGridColumn Case="Upper" Key="ZipSegmentLow">
<RowLayoutColumnInfo OriginX="16" />
<igtbl:UltraGridColumn Case="Upper" Key="ZipSegmentHigh">
<RowLayoutColumnInfo OriginX="17" />
<table id="reMajorSegment" style="width: 275px; height: 25px;">
<asp:Label ID="lblMajorSegment" runat="server" Text="MajorSegment"></asp:Label></td>
<igcmbo:WebCombo ID="WebCombo1" runat="server" BackColor="White" BorderColor="Silver"
BorderStyle="Solid" BorderWidth="1px" ForeColor="Black" SelBackColor="DarkBlue" SelForeColor="White"
<DropDownLayout BorderCollapse="Separate" RowHeightDefault="15px" Version="4.00">
<p align="right">
ListID
<input id="igtbl_TextBox_0_1" columnkey="ListID" style="width: 150px" type="text" /><br />
FamilyID
<input id="igtbl_TextBox_0_2" columnkey="FamilyID" style="width: 150px" type="text" /><br />
Priority
<input id="igtbl_TextBox_0_3" columnkey="Priority" style="width: 150px" type="text" /><br />
MajorSegment
<input id="igtbl_TextBox_0_4" columnkey="MajorSegment" style="width: 150px" type="text" /><br />
Sub-Segment
<input id="igtbl_TextBox_0_5" columnkey="SubSegment" style="width: 150px" type="text" /><br />
Group
<input id="igtbl_TextBox_0_6" columnkey="Group" style="width: 150px" type="text" /><br />
Keycode
<input id="igtbl_TextBox_0_7" columnkey="Keycode" style="width: 150px" type="text" /><br />
Division
<input id="igtbl_TextBox_0_8" columnkey="Division" style="width: 150px" type="text" /><br />
Recency
<input id="igtbl_TextBox_0_9" columnkey="Recency" style="width: 150px" type="text" /><br />
Select
<input id="igtbl_TextBox_0_10" columnkey="Select" style="width: 150px" type="text" /><br />
Frequency
<input id="igtbl_TextBox_0_11" columnkey="Frequency" style="width: 150px" type="text" /><br />
Dollars
<input id="igtbl_TextBox_0_12" columnkey="Dollars" style="width: 150px" type="text" /><br />
SegmentBreak
<input id="igtbl_TextBox_0_13" columnkey="SegmentBreak" style="width: 150px" type="text" /><br />
RecordSource
<input id="igtbl_TextBox_0_14" columnkey="RecordSource" style="width: 150px" type="text" /><br />
BrokerID
<input id="igtbl_TextBox_0_15" columnkey="BrokerID" style="width: 150px" type="text" /><br />
Quantity
<input id="igtbl_TextBox_0_16" columnkey="Quantity" style="width: 150px" type="text" /><br />
ZipSegmentLow
<input id="igtbl_TextBox_0_17" columnkey="ZipSegmentLow" style="width: 150px" type="text" /><br />
ZipSegmentHigh
</p>
<input id="igtbl_reOkBtn" onclick="igtbl_gRowEditButtonClick(event);" style="width: 50px"
type="button" value="OK" />
<input id="igtbl_reCancelBtn" onclick="igtbl_gRowEditButtonClick(event);" style="width: 50px"
</RowEditTemplate>
<BorderDetails WidthBottom="3px" WidthLeft="3px" WidthRight="3px" WidthTop="3px" />
HeaderClickActionDefault="SortMulti" Name="uwgListsEntered" RowHeightDefault="20px" SelectTypeRowDefault="Extended"
BorderWidth="1px" Font-Names="Tahoma" Font-Size="8.25pt" Height="384px"
<ButtonStyle Font-Names="Tahoma" Font-Size="8pt">
</AddNewRowDefault>
<SelectedRowStyleDefault BackColor="LightGray" BorderColor="Transparent" BorderStyle="None"
</SelectedRowStyleDefault>
</IslandStyle>
<ItemStyle CssClass="ContextMenuItem" />
<ignav:Item HoverImageUrl="./cut_over.gif" ImageUrl="./cut.gif"
<HoverImage Url="./cut_over.gif" />
<ignav:Item HoverImageUrl="./copy_over.gif" ImageUrl="./copy.gif"
<HoverImage Url="./copy_over.gif" />
<ignav:Item HoverImageUrl="./paste_over.gif" ImageUrl="./paste.gif"
<HoverImage Url="./paste_over.gif" />
</ignav:Item>
<ignav:Item Separator="True">
<ignav:Item ImageUrl="./excelIcon.gif" Text="Export To Excel">
<DefaultImage AlternateText="Export To Excel" Url="./excelIcon.gif" />
<DisabledStyle Font-Names="MS Sans Serif" Font-Size="8pt" ForeColor="Gray">
<Levels>
</Levels>
<SeparatorStyle CustomRules="background-repeat:repeat-x;" BackgroundImage="~/ig_res/radioflyer/images/ig_menuTri.gif" />
<ExpandEffects ShadowColor="LightGray" />
<MenuClientSideEvents ItemClick="ContextMenuItemClick" InitializeMenu="" ItemChecked="" ItemHover="" SubMenuDisplay="" />
<asp:Button ID="ExportToExcelButton" runat="server" Text="Button" />
</asp:Content>
Hi,
I'm also encountered the same problem, but I guess this problem occurred during the rendering of clientscript to initialize the webmenu control. This is what I found by compared original page (without master page) html source with the content page html source. Found that the root cause is on following generated client script.
igmenu_initMenu('ctl00ContentPlaceHolder1CopyPasteMenu').
Even your menu client name is ctl00_ContentPlaceHolder1_CopyPasteMenu but during rendering it gives other name, try to change following line in ShowContentMenu function, by replace the following line with
igmenu_showMenu("<%=me.CopyPasteMenu.ClientID%>",null,(e.clientX+document.documentElement.scrollLeft)+"px",(e.clientY+document.documentElement.scrollTop)+"px");
To
igmenu_showMenu("Parameter value name in igmenu_initMenu() in your source page",null,(e.clientX+document.documentElement.scrollLeft)+"px",(e.clientY+document.documentElement.scrollTop)+"px"); It should working fine but this is not a full solution, I hope the infragistic team can help to solve this problem.
From
AvaSenoko.
Indeed, this is correct - the ClientID of the menu needs to be used for client-side operation and we do remove "_" characters from the ClientID. We typically advise customers to get the instance to their client-side menu object in the InitializeMenu event - the correct client-side ID is passedas the first parameter and can be used to obtain the instance of the menu.
For example:
<ignav:UltraWebMenu ID="UltraWebMenu1_test" runat="server" JavaScriptFilename="" JavaScriptFileNameCommon="" LeafItemImageUrl="" ParentItemImageUrl="" StyleSetName=""> <MenuClientSideEvents InitializeMenu="initMenu"/> ... </ignav:UltraWebMenu> <script type="text/javascript"> var menuInstance; function initMenu(menuId) { menuInstance = igmenu_getMenuById(menuId); } </script>
Hope this helps.