在 XtraGridview 控件中显示 ContextMenuStrip 时出现问题
我有一个 ContextMenustrip & DevExpress XtraGridView
。当用户右键单击 XtraGridView 时,我向用户显示了 ContextMenustrip,为此我使用了 XtraGridView 的 MouseDown() 事件。此应用程序的问题是,当我的 gridview 包含最少行时,它会在 Gridview 末尾显示一些空白空间。当用户右键单击 gridview 时,我不想在 XtraGridView 的空白区域中显示 ContextMenustrip。我只想仅在选定的行位置显示 ContextMenustrip。 这样是否可以避免这个问题呢?
谢谢..
I'm having one ContextMenustrip
& DevExpress XtraGridView
. And i shown the ContextMenustrip to the user when user right clicks on the XtraGridView, for that i used XtraGridView's MouseDown()
event. Issue of this application is that when my gridview contains minimum rows then it shows the some empty space at the end of the Gridview. And i don't want to show the ContextMenustrip in that empty space of the XtraGridView when user right click on the gridview. I just want to show the ContextMenustrip at selected row position only.
Is this possible to avoid this problem?
thanks..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您使用稍微不同的方法。处理 GridView 的 PopupMenuShowing 事件,如下所示,以确保菜单仅在打开时打开必要的。
I would suggest that you use slightly different approach. Handle the GridView's PopupMenuShowing event as shown below to make certain that your menu is open only when it is necessary.