Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Tuesday, October 29, 2013 11:04 PM
I can't seem to figure out how to keep the winForm dataGridView from moving to the next row after pressing Enter while in editMode. Actually after pressing Enter and committing my edit I'd like to keep the cell in focus AND in editMode!
Can someone please help me out here?
Thanks in advance,
-DA
dee allen
All replies (2)
Wednesday, October 30, 2013 6:10 AM âś…Answered
Hi d.allen101,
You can customize the DataGridView to override the ProcessDialogKey method:
public class CustomGrid : DataGridView {
protected override bool ProcessDialogKey(Keys keyData) {
if (keyData == Keys.Enter) {
EndEdit();
return true;
}
return base.ProcessDialogKey(keyData);
}
}
Or you can refer to the following article:How to prevent going to next row after editing a DataGridViewTextBoxColumn and pressing EnterKey?
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.
Wednesday, October 30, 2013 3:07 AM
I can't seem to figure out how to keep the winForm dataGridView from moving to the next row after pressing Enter while in editMode. Actually after pressing Enter and committing my edit I'd like to keep the cell in focus AND in editMode!
Can someone please help me out here?
Thanks in advance,
-DA
dee allen