dev GridControl 实现双击行事件

单纯的去找双击确实不好实现,就用以下的方式来实现了:

  //实现双击打开功能
        private void gridView1_MouseDown(object sender, MouseEventArgs e)
        {
            GridHitInfo hInfo = gridView1.CalcHitInfo(new Point(e.X, e.Y));
            //双击功能
            if (e.Button == MouseButtons.Left && e.Clicks == 2)
            {
                //获取当前选中的项目,若没有给出提示
                if (string.IsNullOrEmpty(m_sSelProjNum)) return;
                frm2NewPrj frm = null;
                if (m_bEdit)
                    frm = new frm2NewPrj(ProjEditWidowOpenMode.OPENMODE_EDIT, m_sSelProjNum, m_sSelProjName, this);
                else
                    frm = new frm2NewPrj(ProjEditWidowOpenMode.OPENMODE_QUERY, m_sSelProjNum, m_sSelProjName, this);
                frm.ShowDialog();
                frm.Dispose();
            }

        }

即调用的是MouseDown事件,具体的逻辑具体实现就行了

你可能感兴趣的:(dev,gridcontrol)