Why didn't trigger the CellEndEdit event of DataGridView

后端 未结 3 1897
遇见更好的自我
遇见更好的自我 2021-01-22 20:25

All,I knew we can set a column editable for a DataGridView. And when finish editing the cell. the CellEndEdit event would be triggered. But I just want

3条回答
  •  忘掉有多难
    2021-01-22 20:43

    Before BeginEdit. Set a variable to identify if current state is edit mode.

    bBeginEdit = true;
    dgvFileList.BeginEdit(false);
    

    In the Form_Click event

            if (bBeginEdit)
            {
                dgvFileList.EndEdit();
                bBeginEdit = false;
            }
    

    Thanks,

    Joe

提交回复
热议问题