DEV gridcontrol双击行事件

        private void gridView1_MouseDown(object sender, MouseEventArgs e)
        {
            try
            {
                DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo hInfo = gridView1.CalcHitInfo(new Point(e.X, e.Y));
                if (e.Button == MouseButtons.Left && e.Clicks == 2)//判断是否左键双击
                {
                    //判断光标是否在行范围内
                    if (hInfo.InRow)
                    {
                        //写双击后需要执行的程序
                    }
                }
            }
            catch (Exception ex)
            {
                IM_IOT_ST.Tools.ExceptionHelper.ShowException(ex);
            }
        }

你可能感兴趣的:(DEV gridcontrol双击行事件)