This is a migrated thread and some comments may be shown as answers.

get to sub-menu items

1 Answer 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rik butcher
Top achievements
Rank 1
rik butcher asked on 20 Jul 2011, 07:32 PM
i have a rad context menu like this.(on a radGrid)

 

 

<telerik:RadContextMenu ID="OptionsRadContextMenu" runat="server" Skin="WebBlue"

 

 

 

CssClass="leftText">

 

 

 

<Targets>

 

 

 

<telerik:ContextMenuControlTarget ControlID="PopupMenuImage" />

 

 

 

</Targets>

 

 

 

<Items>

 

 

 

<telerik:RadMenuItem Text="Copy" ImageUrl="../App_Themes/GOLD Main/ToolBar/save_16x16.gif" />

 

 

 

<telerik:RadMenuItem Text="Post Results" ImageUrl="../App_Themes/GOLD Main/ToolBar/edit_16x16.gif" />

 

 

 

<telerik:RadMenuItem Text="Item Inspection Report">

 

 

 

<Items>

 

 

 

<telerik:RadMenuItem Text="Details" ImageUrl="../App_Themes/GOLD Main/ToolBar/print_16x16.gif" />

 

 

 

<telerik:RadMenuItem Text="Summary" ImageUrl="../App_Themes/GOLD Main/ToolBar/print_16x16.gif" />

 

 

 

</Items>

 

 

 

</telerik:RadMenuItem>

 

 

 

</Items>

 

 

 

</telerik:RadContextMenu>

on Databind i declare my pop up menu and bind to the first two.

 

RadMenu

 

 

RadPopupMenu = (RadMenu)e.Item.Cells[0].FindControl("OptionsRadContextMenu");

 

RadPopupMenu.Items[0].NavigateUrl =

 

String.Format("javascript:OpenCopyItem({0},{1},{2},{3},{4})", woid, detailid, wonumber, locationid, wolinenumber);

 

RadPopupMenu.Items[1].NavigateUrl =

 

String.Format("javascript:OpenPostResults({0},{1})", woid, detailid, wonumber, locationid);

 

 

 

my question is how can i get to the "sub-menus" or the item that has other items? once i try to reference past [1] to say "RadPopupMenu.Items[2]" - i get an error. any help is appreciated.
thanks again
rik


1 Answer, 1 is accepted

Sort by
0
rik butcher
Top achievements
Rank 1
answered on 20 Jul 2011, 08:24 PM
i figured this out 20 mins after i posted this. geeze.
created a submenu item

 

 

RadMenu RadPopupMenu = (RadMenu)e.Item.Cells[0].FindControl("OptionsRadContextMenu");

 

 

 

RadMenuItem subMen = RadPopupMenu.Items[5];

then simply referenced that with the indexes that were underneath it. thanks. 

 

subMen.Items[0].NavigateUrl =

 

String.Format("javascript:PrintReport_InspectionDetails({0})", woid);

 

subMen.Items[1].NavigateUrl =

 

String.Format("javascript:PrintReport_InspectionSummary({0})", woid);

 

Tags
Grid
Asked by
rik butcher
Top achievements
Rank 1
Answers by
rik butcher
Top achievements
Rank 1
Share this question
or