Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
150
WebDataMenu in gridview
posted

Hello,

I have a button OnclientClick function.

<asp:Button ID="Button1" runat="server" OnClientClick="Node_Click();" />

My javascript function is

function Node_Click(tree, eventArgs) {
        lastNode = eventArgs.getNode();
        var menu = $find("<%= ContextMenu.ClientID %>");

        if (menu != null && eventArgs.get_browserEvent() != null && eventArgs.get_browserEvent().button == 2) {
            menu.showAt(null, null, eventArgs.get_browserEvent());
        }
       
My question is How can I pass the value EventArgs from my Onclientclick function.

Right now it is returning null.

Parents
  • 5124
    posted

    HI Sanjay,

    Per our chat conversation, I will be looking into these questions:

    1.) Given that you have a button in an asp:GridView, you want to show the WebDataMenu on a right-click of the button, but you are unable to do so, as the eventArgs passed to the Node_Click() event is null.


    aspx code:

    Button in the gridview: <asp:Button ID="Button1" runat="server" OnClientClick="Node_Click();" />

    WebDataMenu: <ig:WebDataMenu runat="server" ID="ContextMenu" IsContextMenu="true" BorderWidth="1" BorderColor="#CCCCCC" >
            <ClientEvents ItemClick="MenuItem_Click" />
           
            <Items>
                <ig:DataMenuItem Text="CaseSummary" Key="edit" />
                <ig:DataMenuItem Text="Plaintiff" Key="expand"  />
                <ig:DataMenuItem Text="Defendant" Key="Explore"  />           
                <ig:DataMenuItem Text="Notes" Key="New" />
                <ig:DataMenuItem Text="Incident" Key="Delete" />
                <ig:DataMenuItem Text="Negotiation" Key="Sento" />
            </Items>          
        </ig:WebDataMenu><asp:Button ID="Button1" runat="server" OnClientClick="Node_Click();" />

    BLOCKED SCRIPT

    function Node_Click(tree, eventArgs) {
            lastNode = eventArgs.getNode();
            var menu = $find("<%= ContextMenu.ClientID %>");

            if (menu != null && eventArgs.get_browserEvent() != null && eventArgs.get_browserEvent().button == 2) {
                menu.showAt(null, null, eventArgs.get_browserEvent());
            }

     2.)  How can the WebDataMenu be implemented inside the gridview?

     

    Thanks,

    Francis

     

Reply Children
No Data