M
Mark Yorkovich
Guest
In a VB.NET project Im building in VS2013 I have some DataGridViews in which, currently only moving to a new cell with the Enter key will retain the previous cells changes when the Save button is clicked. If the user moves to a new cell using the Tab key, the Arrow keys or mouse-clicking anywhere outside of the cell the change isnt retained.
Put another way: if after editing a DGV cell, the user navigates to another cell by using the Enter key, when the Save button is clicked the edited value is saved to the database, but if, after editing a cell, the user navigates to another cell with any of the other methods (arrow, tab, mouse-out), when the Save button is clicked, then the value the user entered is not saved. Its as if using the Enter key is the only way that the edit value is "committed" to the SqlDataAdapter (or whatever the value goes to for saving to the DB).
Ive been watching the CellEndEdit, CellLeave, and CellValidating events and Im not seeing why its just using the Enter key that the changed value is retained. Part of that problem is, Im not sure what property I need to be watching to determine the original and edited values after the different types of navigation are used.
How can I make it so that navigating with mouse, arrows, tab will keep the changes too?
Continue reading...
Put another way: if after editing a DGV cell, the user navigates to another cell by using the Enter key, when the Save button is clicked the edited value is saved to the database, but if, after editing a cell, the user navigates to another cell with any of the other methods (arrow, tab, mouse-out), when the Save button is clicked, then the value the user entered is not saved. Its as if using the Enter key is the only way that the edit value is "committed" to the SqlDataAdapter (or whatever the value goes to for saving to the DB).
Ive been watching the CellEndEdit, CellLeave, and CellValidating events and Im not seeing why its just using the Enter key that the changed value is retained. Part of that problem is, Im not sure what property I need to be watching to determine the original and edited values after the different types of navigation are used.
How can I make it so that navigating with mouse, arrows, tab will keep the changes too?
Continue reading...