Reputation: 35
how to customize the right click menu on gridcontrol? I try tp put the export option on the menu. I try to search inside the Grid Design still unable to find it. Try to google this for weeks. Need guidance from the master. TQ
Upvotes: 1
Views: 960
Reputation: 1259
You can handle the GridView's PopupMenuShowing event and customize the built-in Grid menu(s):
private void gridView1_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
{
if (e.MenuType != DevExpress.XtraGrid.Views.Grid.GridMenuType.Column)
return;
DXMenuItem restoreItem = new DXMenuItem() { Caption = "Restore Layout" };
restoreItem.Click += restoreItem_Click;
e.Menu.Items.Add(restoreItem);
}
private void restoreItem_Click(object sender, EventArgs e)
{
MessageBox.Show("Restoring layout...");
}
See also: How to: Implement Custom Menu in XtraGrid Control
Upvotes: 1
Reputation: 481
There is a single control name contextmenu you can add it from code or designer then add some events. you can google it youself or Adding a right click menu to an item
Upvotes: 1