Dev的双击Gridview的DoubleClick

注意: 是GridView的Double而不是GridControl
private void gridView1_DoubleClick(object sender, EventArgs e)
{
    GridView detailGrid = (sender as GridView);
    GridHitInfo hitInfo = (detailGrid.CalcHitInfo((e as MouseEventArgs).Location));

    if (hitInfo != null && (hitInfo.InRow || hitInfo.InRowCell) && hitInfo.RowHandle >= 0)
    {
        DataRow row = detailGrid.GetDataRow(hitInfo.RowHandle);
        //读取日志内容
        string fileName = row["执行日志名称"].ToString();               
        ReportLogForm form = new ReportLogForm();
        form.ShowLog(fileName);
        form.Show();
    }
}

你可能感兴趣的:(Dev的双击Gridview的DoubleClick)