RadGridView 检测 CellClick 事件按钮 [英] RadGridView detect CellClick event button

查看:37
本文介绍了RadGridView 检测 CellClick 事件按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检测在 CellClick 事件中按下了哪个鼠标按钮,或者如何检测在 MouseClick 事件中按下了哪个单元格.

How can I detect which mouse button was pressed in event CellClick, or how can I detect which cell was pressed in event MouseClick.

推荐答案

您可以通过使用鼠标单击事件来检测单击了哪个单元格.

You can detect which cell was clicked by using Mouse Click event.

然后您必须将 sender 强制转换为 RadGridView,然后使用 CurrentCell 属性.

Then you have to cast sender to RadGridView, and then use CurrentCell property.

GridViewCellInfo dataCell = (sender as RadGridView).CurrentCell;

如果您想点击哪个鼠标按钮,请使用:

If you want to which mouse button was clicked use:

if (e.Button == MouseButtons.Right)
{
//your code here
}

这篇关于RadGridView 检测 CellClick 事件按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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