XtraGridControl 实现双击修改数据

private void GridView1_MouseDown(object sender, MouseEventArgs e)
{
    GridView view = sender as GridView;
    GridHitInfo hitInfo = view.CalcHitInfo(e.Location);
    if (hitInfo.InRowCell && e.Button == System.Windows.Forms.MouseButtons.Left)
    {
        if (e.Clicks == 1)
        {
            view.FocusedColumn = hitInfo.Column;
            view.FocusedRowHandle = hitInfo.RowHandle;

        }
        else if (e.Clicks == 2)
            view.ShowEditor();
        DXMouseEventArgs.GetMouseArgs(e).Handled = true;
    }
}



你可能感兴趣的:(DevExpress,XtraGridControl)