天天看點

Devexpress 之gridControl輕按兩下行事件

MouseDown事件

protected internal void gridControl1_MouseDown(object sender, MouseEventArgs e)

{

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)

//MessageBox.Show(hInfo.RowHandle.ToString());

}