答案 0 :(得分:0)
您可以从代码或设计器添加一个控件名称 contextmenu ,然后添加一些事件。你可以自己谷歌或Adding a right click menu to an item
答案 1 :(得分:0)
您可以处理GridView的PopupMenuShowing event并自定义内置的网格菜单:
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...");
}