I have a C# lookup window that I wanted to add hitting the Enter/Return key to return the value. As soon as I did that it killed double click. As soon as I move the mouse pointer the lookup window exits. How do I get this to work so both double-click and Enter return the value?
private void dgvBatches_DoubleClick(object sender, EventArgs e)
{
int currentRow;
currentRow = dgvBatches.CurrentCell.RowIndex;
dgvBatches.CurrentCell = dgvBatches[0, currentRow];
CellValue = dgvBatches.CurrentCell.Value.ToString();
DialogResult = DialogResult.OK;
return;
}
private void dgvBatches_Enter(object sender, EventArgs e)
{
int currentRow;
currentRow = dgvBatches.CurrentCell.RowIndex;
dgvBatches.CurrentCell = dgvBatches[0, currentRow];
CellValue = dgvBatches.CurrentCell.Value.ToString();
DialogResult = DialogResult.OK;
return;
}