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

How to: Show ContextMenu in Grid by click in LinkButton

1 Answer 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 09 Aug 2008, 12:30 PM
Hi All.

In Grid:
<telerik:GridTemplateColumn>    
<ItemTemplate>    
<asp:LinkButton ID="LinkButton7" runat="server">Open ContextMenu</asp:LinkButton>    
</ItemTemplate>    
</telerik:GridTemplateColumn> 

How to show ContextMenu when user click on LinkButton?

I have jscript function:

function RowContextMenu(sender, eventArgs)     
                    {     
                        var menu = $find("<%= RadMenu1.ClientID %>");     
                        var evt = eventArgs.get_domEvent();     
                             
                        var index = eventArgs.get_itemIndexHierarchical();     
                        document.getElementById("radGridClickedRowIndex").value = index;     
                             
                        sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(), true);     
                             
                        menu.show(evt);     
                             
                        evt.cancelBubble = true;     
                        evt.returnValue = false;     
    
                        if (evt.stopPropagation)     
                        {     
                           evt.stopPropagation();     
                           evt.preventDefault();     
                        }     
                    }    
 

and this function working when OnRowContextMenu raised.

Maybe i can raise this event programatically on OnClientClick of LinkButton?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Andy
Top achievements
Rank 1
answered on 09 Aug 2008, 03:47 PM
Uh....
I did it already.
All works properly!
Tags
Grid
Asked by
Andy
Top achievements
Rank 1
Answers by
Andy
Top achievements
Rank 1
Share this question
or