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

show context menu on gridbuttoncolumn click

1 Answer 11 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Savyo
Top achievements
Rank 1
Savyo asked on 02 Sep 2013, 12:25 PM
   
   Hi,

            How do I show context menu on clicking gridbuttoncolumn. Can anybody help??

  thanks.
  Savyo

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 02 Sep 2013, 12:28 PM
Hi,

Please try the following code snippet to show context menu on GridButtonColumn click

C#:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
  if (e.Item is GridDataItem)
  {
   GridDataItem item = (GridDataItem)e.Item;
   LinkButton btn = (LinkButton)item["Uniquename"].Controls[0];
   btn.OnClientClick = "showMenu(this, event); return false;";
  }
}

Javascript:
function showMenu(sender, args) {
        var contextMenu = $find("<%= RadContextMenu1.ClientID %>");
        contextMenu.show(args);
}

Thanks,
Princy.
Tags
Grid
Asked by
Savyo
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or