Removing the default Context Menu when Editing a cell in DataGridView

北城以北 提交于 2019-12-13 07:24:06

问题


In my DataGridView, when I am editing a textbox cell, and I right click I get the following default Context Menu:

How can I disable this "feature" and instead have my own context Menu popup?


回答1:


Is this is what you asking about? You can find the similar question using this link.

    private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
    {
        e.Control.ContextMenuStrip = myContextMenuStrip;
    }


来源:https://stackoverflow.com/questions/16309613/removing-the-default-context-menu-when-editing-a-cell-in-datagridview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!