gridcontrol控件的row双击事件,用gridview的Double_Click没实现,网上查了一下MouseDown,试了试,挺爽。需要将gridview1.OptionsBehavior.Editable设为false
代码
//双击行弹出nodeDetail信息
private void gridView1_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)
{
//do something
}
}
}
private void gridView1_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)
{
//do something
}
}
}