【问题标题】:How to perform an action on double click for GridControl如何在双击 GridControl 时执行操作
【发布时间】:2012-02-07 22:30:42
【问题描述】:

我有一个GridControl

    private void gridControl1_DoubleClick(object sender, EventArgs e)
    {
        GridControl grid = sender as GridControl;            
        DXMouseEventArgs args = e as DXMouseEventArgs;
        BaseHitInfo hitInfo = grid.Views[0].CalcHitInfo(args.Location);
        MessageBox.Show("Hello World");
    }

如果用户双击行数据,我怎样才能显示MessageBox.Show("Hello World")?即使用户双击空白,上面的代码也会显示 hello world。

【问题讨论】:

    标签: c# winforms devexpress xtragrid


    【解决方案1】:

    hitInfo 转换为GridHitInfo 并检查HitTest 属性。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-26
      • 1970-01-01
      • 1970-01-01
      • 2023-03-05
      • 2011-02-03
      • 1970-01-01
      相关资源
      最近更新 更多