DataGridView上下文菜单 [英] DataGridView Context Menu

查看:182
本文介绍了DataGridView上下文菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何右键单击指定的行,这意味着右键单击仅影响当前行!在我单击菜单的DataGridView中没有出现.




当用户右键单击数据网格视图并从上下文菜单中选择一项时,如何跟踪数据菜单视图中特定行上的上下文菜单条更改. (上下文菜单的显示已经可以使用.)

How can I right click a specify row, it means the right click just influence in current row!!! not anywhere in DataGridView I clicked the menu appear.




How can I track the Context Menu Strip changes on a specific row in Data Grid View when user right click on the data grid view and select an item from context menu. (The display of context menu is already working).

推荐答案

您需要处理称为RowContextMenuStripChangedDataGridView 事件.当上下文菜单条在特定行上更改时,将触发此事件.您可以在事件方法中通过e.Row获取Row.
You need to handle an event of DataGridView called RowContextMenuStripChanged. This event will fire when context menu strip changes on a specific row. you can get the Row by e.Row inside the event method.


这篇关于DataGridView上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆