I have a datagridview on a form, and I want a specific cell in the first row to be in edit mode when the form opens and when the selection changes. The DataGridView selectmode is set to "FullRowSelect" and in the selection change event I have the following code:
if (dgvReconList.SelectedRows.Count == 1)
{
dgvReconList.CurrentCell = dgvReconList.SelectedRows[0].Cells["colReferralDate"];
dgvReconList.BeginEdit(true);
}
That code works like a charm when I change the selection. The problem is that when I try to set the desired cell in the first row to edit mode (using above code) when the form opens. The first row is selected, and the desired cell is the "current" cell, but it is not in edit mode. I have tried using the above code in the forms activate event, the load event, and several others with no luck.
How can I get the cell to be in edit mode as soon as the form opens?