using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
private void gridView1_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
{
GridView view = sender as GridView;
GridHitInfo hitInfo = view.CalcHitInfo(e.Point);
if(hitInfo.InRow)
{
//GridView Caption也显示右键菜单,但不会执行下两行代码
view.FocusedRowHandle = hitInfo.RowHandle;
contextMenuStrip1.Show(view.GridControl, e.Point);
}
}