有谁知道如何处理数据格力上的右键事件吗?我看了看文件,但什么也没找到。
发布于 2022-12-02 18:54:09
您需要添加一个ContextMenuStrip组件。
一旦在网格视图中添加了ContextMenuStrip组件,就可以查找ContextMenuStrip属性并指定添加的属性。
在ContextMenuStrip中添加所需的选项,例如编辑或删除。
在每个按钮中添加一个click事件,并使用以下代码:
private void EditToolStripMenuItem_Click(object sender, EventArgs e)
{
//With this code we retrieve the information from the table where the right click was executed
var info = gridview1.GetFocusedRow();
code....
}PS: C#代码。
当你问问题时,请注明你使用的是哪种语言。
对不起,我的英语,但我的母语是西班牙语。
https://stackoverflow.com/questions/74624966
复制相似问题