如何显示RepositoryItemHyperLinkEdit控制在一个DevExpress GridControl

有时我们使用RepositoryItemHyperLinkEdit的OpenLink或Click事件无响应时可以使用gridView_MouseUp事件以吸引点击事件没有等待,网格单元获得焦点:

gridColumn.ColumnEdit = new RepositoryItemHyperLinkEdit();
gridColumn.OptionsColumn.ReadOnly = true;
gridColumn.OptionsColumn.AllowEdit = false;

gridView.MouseUp += gridView_MouseUp;

private void gridViewDesk_MouseUp(object sender, MouseEventArgs e)
{
    GridView gridView = (GridView) sender;
    if (e.Button == MouseButtons.Left && e.Clicks == 1)
    {
        GridHitInfo hitInfo = gridView.CalcHitInfo(e.Location);
        if (hitInfo.InRowCell && hitInfo.Column == this.gridColumn)
        {
            MessageBox.Show("Click " + hitInfo.RowHandle);
        }
    }
}



你可能感兴趣的:(winForm)