Popup Menu Cell Click or Image Click

1 posts, 0 answers
  1. Akhil Raj
    Akhil Raj avatar
    69 posts
    Member since:
    Aug 2012

    Posted 10 Oct 2011 Link to this post

    hi all,
      I need context menu in cell click or image button click instead of right click like popup menu
    I have GridImageColumn in the grid. When i click the particluar cell or image i need to open my context menu and highlight the clicked row as selected and i can pass the selected row to the rad window.

    I did except the row selection and id picking. Can anyone help me about this?

    My page is:

      function showMenu(e) 
        {
            var contextMenu = $find("<%= RadContextMenu1.ClientID %>");
            contextMenu.show(e);
    //        $telerik.cancelRawEvent(e);
        }
      
        function MenuItemClicked(sender, eventArgs) {
      
                var clickedItemValue = eventArgs.get_item().get_text();
                switch(clickedItemValue)
                {
                    case "Option2":
                    var win = radopen("WebForm2.aspx?id=" + clickedItemValue, "RadWindow1");
                    var oWnd = GetRadWindowManager().getActiveWindow();
                        oWnd.maximize();
                        return false;
                        break;
                    default:
                        alert(clickedItemValue);
                        break;
                }
        }
      
      
    </script>
      
      
        <Telerik:RadContextMenu id="RadContextMenu1" runat="server"
             EnableRoundedCorners="true" EnableShadows="true" OnClientItemClicked="MenuItemClicked">
        <Items>
            <Telerik:RadMenuItem Text="Option1" />
            <Telerik:RadMenuItem Text="Option2" />
            <Telerik:RadMenuItem Text="Option3" />
        </Items>
        </Telerik:RadContextMenu>
      
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" >
        <MasterTableView runat="server">
            <Columns>
                <telerik:GridTemplateColumn>
                    <ItemTemplate>
                        <asp:ImageButton ID="imgMenu" runat="server" ImageUrl="" OnClientClick="showMenu(event)" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridImageColumn HeaderText="#" ImageUrl="" ></telerik:GridImageColumn>
                <telerik:GridBoundColumn HeaderText="User Name" DataField="UserName"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="First Name" DataField="FirstName"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="Last Name" DataField="LastName"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="Email" DataField="Email"></telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
        </telerik:RadGrid>
            <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false"
            ReloadOnShow="true" runat="server" EnableShadow="true">
            <Windows>
                <telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Close" >
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>

    Here i can click and show the context menu by putting asp image in the template column but how can i get the row of the image and highlight the row?

    Instead i try with GridImageColumn. But not found any cell click event or click  in Imagecolumn events. So how can i achive this?
Back to Top