GridControl添加右键菜单

private void gridView1_MouseDown(object sender, MouseEventArgs e)
        {
            GridHitInfo vi = gridView1.CalcHitInfo(e.Location);

            if (vi.InRow&&e.Button == MouseButtons.Right)
            {
                //gridAllFBF.ContextMenuStrip = cmsFBF;
                cmsFBF.Show(gridAllFBF,e.Location);
            }
        }

 


注意:是在GridControl里的gridView1.MouseDown事件,而不是GridControl的。

gridAllFBF是GridControl控件

转载于:https://www.cnblogs.com/joysky/p/3972428.html

你可能感兴趣的:(GridControl添加右键菜单)