G
Guest
I'm using C# on a Windows Form with a datagrid.
I want to trap when a user hits ENTER (or Tab on the last column) so that I can auto add a new row and prepopulate with default values from the previous row. It not be assumed that column values were actually changed on the current row.
I have trapped the PreProcessMessage event on the grid, but that doesn't fire if a column in the grid has focus.
I have tried to trap the keyCode in the Column_Changed event, but it says it is out of scope.
Basically, this is the psuedocode:
User is on row X of a datagrid and wants to add a new line so they hit ENTER
The app needs to add a new row to the datatable and set default values based on the previous row.
The app needs to set the cursor to the first field on the new row.
Any assistance is appreciated.
Larry
I want to trap when a user hits ENTER (or Tab on the last column) so that I can auto add a new row and prepopulate with default values from the previous row. It not be assumed that column values were actually changed on the current row.
I have trapped the PreProcessMessage event on the grid, but that doesn't fire if a column in the grid has focus.
I have tried to trap the keyCode in the Column_Changed event, but it says it is out of scope.
Basically, this is the psuedocode:
User is on row X of a datagrid and wants to add a new line so they hit ENTER
The app needs to add a new row to the datatable and set default values based on the previous row.
The app needs to set the cursor to the first field on the new row.
Any assistance is appreciated.
Larry