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

ContextMenu not showing in radgrid

1 Answer 30 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 10 Sep 2019, 04:01 PM

     Hello, I'm having trouble getting a context menu to appear on my page that's using the Master page template. I have a RadGrid with draggable rows populated by backend SQL that I would like to have a context menu on, with options that would run different SQL updates server-side when a user picks an option (like closing a case for example via UPDATE). Below is the relevant. Currently, dragging still works but no context menu appears on right click. I'm a relatively new developer, so there's absolutely the possibility that I'm missing something basic.

 

 

01.<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="Admin.aspx.cs" Inherits="Medicare_Escalations.Admin" %>
02.<asp:Content ID="Content_AdminHeader" ContentPlaceHolderID="head" Runat="Server">
03.    <link href="styles/admin.css" rel="stylesheet" />
04.    
05.</asp:Content>
06. 
07.<asp:Content ID="Content_AdminBody" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
08.     
09.          
10.          
11.     <telerik:RadWindowManager RenderMode="Lightweight" ID="RadWindowManagerAdmin" runat="server" EnableShadow="true">
12.        </telerik:RadWindowManager>
13.     
14.     
15.            <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
16.            <AjaxSettings>
17.                <telerik:AjaxSetting AjaxControlID="drpdnCaseWorkersForReason">
18.                    <UpdatedControls>
19.                        <telerik:AjaxUpdatedControl ControlID="gridView_Caseload"
20.                            LoadingPanelID="RadAjaxLoadingPanel_Caseload" />
21.                    </UpdatedControls>
22.                </telerik:AjaxSetting>
23.                <telerik:AjaxSetting AjaxControlID="gridView_Cases">
24.                    <UpdatedControls>
25.                        <telerik:AjaxUpdatedControl ControlID="gridView_Caseload"
26.                            LoadingPanelID="RadAjaxLoadingPanel_Caseload" />
27.                        <telerik:AjaxUpdatedControl ControlID="gridView_Cases"
28.                            LoadingPanelID="RadAjaxLoadingPanel_Cases" />
29.                    </UpdatedControls>
30.                </telerik:AjaxSetting>
31.            </AjaxSettings>
32.        </telerik:RadAjaxManagerProxy>
33.    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel_Cases" runat="server">
34.        </telerik:RadAjaxLoadingPanel>
35.      
36.         
37.    <telerik:RadAjaxPanel runat="server" ID="radUpdatePanel_AdminCases" LoadingPanelID="RadAjaxLoadingPanel_AdminCases">
38.         
39.                <telerik:RadGrid RenderMode="Lightweight" runat="server" ID="gridView_Cases" OnNeedDataSource="gridView_Cases_NeedDataSource" ClientSettings-Scrolling-AllowScroll="true" 
40.                    Width="1175px" Height="313px" AllowPaging="True" AllowMultiRowSelection="false" AutoGenerateColumns="false" OnSelectedIndexChanged="gridView_Cases_SelectedIndexChanged" OnItemDataBound="gridView_Cases_ItemDataBound"
41.                    Font-Size="Small" OnRowDrop="gridView_Cases_RowDrop">
42.         
43.                    <MasterTableView DataKeyNames="ESCL_CASE_ID,ITEM_ID,URGNCY_IND,MBR_UMI_ID,ESCL_RSN_CD,ESCL_RSN_DSC,Case_owner_name,Member_Name,ESCL_CASE_RTE_SK,ESCL_CASE_OWN_ID,ESCL_STS_CD,User_Active,ESCL_STS_DSC,ESCL_CASE_EFF_TS">
44.                        <Columns>
45.                            <telerik:GridBoundColumn DataField="ESCL_CASE_ID" HeaderText="Case ID" HeaderStyle-Width="20px"></telerik:GridBoundColumn>
46.                            <telerik:GridBoundColumn DataField="ITEM_ID" HeaderText="Item ID" HeaderStyle-Width="120px"></telerik:GridBoundColumn>
47.                            <telerik:GridBoundColumn DataField="URGNCY_IND" HeaderText="Is this Urgent?" HeaderStyle-Width="20px"></telerik:GridBoundColumn>
48.                            <telerik:GridBoundColumn DataField="MBR_UMI_ID" HeaderText="Member UMI"></telerik:GridBoundColumn>
49.                            <telerik:GridBoundColumn DataField="ESCL_RSN_DSC" HeaderText="Escalation Reason"></telerik:GridBoundColumn>
50.                            <telerik:GridBoundColumn DataField="ESCL_RSN_CD" HeaderText="Reason Code" Visible="false"></telerik:GridBoundColumn>
51.                            <telerik:GridBoundColumn DataField="Case_owner_name" HeaderText="Case Owner"></telerik:GridBoundColumn>
52.                            <telerik:GridBoundColumn DataField="Member_Name" HeaderText="Member Name"></telerik:GridBoundColumn>
53.                            <telerik:GridBoundColumn DataField="ESCL_CASE_RTE_SK" HeaderText="Route Number" Visible="false"></telerik:GridBoundColumn>
54.                            <telerik:GridBoundColumn DataField="ESCL_CASE_OWN_ID" HeaderText="Owner ID" Visible="false"></telerik:GridBoundColumn>
55.                            <telerik:GridBoundColumn DataField="ESCL_STS_CD" HeaderText="Status Code" Visible="false"></telerik:GridBoundColumn>
56.                            <telerik:GridBoundColumn DataField="User_Active" HeaderText="User Active?" UniqueName="User_Active"></telerik:GridBoundColumn>
57.                            <telerik:GridBoundColumn DataField="ESCL_STS_DSC" HeaderText="Status" HeaderStyle-Width="20px"></telerik:GridBoundColumn>
58.                            <telerik:GridBoundColumn DataField="ESCL_CASE_EFF_TS" HeaderText="Creation Time"></telerik:GridBoundColumn>
59.                        </Columns>
60.                    </MasterTableView>
61.                    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true" AllowRowsDragDrop="true" ClientEvents-OnRowContextMenu="OpenAdminRowContextMenu">
62.                        <Selecting AllowRowSelect="true" EnableDragToSelectRows="false"/>
63.                             
64.                    </ClientSettings>
65.                    <PagerStyle Mode="NumericPages"></PagerStyle>
66.                </telerik:RadGrid>
67.                <telerik:RadContextMenu runat="server" ID="AdminContextMenu"
68.                    EnableRoundedCorners="true" EnableShadows="true" OnItemClick="AdminContextMenu_ItemClick" >
69.                 
70.                    <Items>
71.                        <telerik:RadMenuItem Text="All Devices" Value="allDevices" />
72.                          </Items>
73.                </telerik:RadContextMenu>
74.             
75.                  <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
76.                <script type="text/javascript">
77.                    function OpenAdminRowContextMenu() {
78.                         
79. 
80.                        var evt = args.get_domEvent();
81.                        if (evt.target.tagName == "INPUT" || evt.target.tagName == "A")
82.                            return;
83. 
84.                        var menu = $find("<%= AdminContextMenu.ClientID %>");
85.                        menu.show(evt);
86.                    }
87.                </script>
88.            </telerik:RadScriptBlock>
89.       </telerik:RadAjaxPanel>        
90.</asp:Content>

1 Answer, 1 is accepted

Sort by
0
Sam
Top achievements
Rank 1
answered on 11 Sep 2019, 01:34 PM
fixed. javascript was missing parameter definition.
Tags
Grid
Asked by
Sam
Top achievements
Rank 1
Answers by
Sam
Top achievements
Rank 1
Share this question
or