C datagridview cellvalidating event dating information age
SOLUTION To achieve data validation prior the row is committed, you can handle the Cell Validating event, which is raised by the control when the current cell changes or when it goes out of edit mode.
To determine the state of the current cell, use the Data Grid View Cell Validating Event Args. When this event is canceled in data-bound mode, the new value is not pushed to the underlying data source.
The Data Bound Item will be updated only if the cell is validated.
However, the user may prefer to validate all the data cells in a row at once.
I want to refactor this code that is currently in a partial Form Class and deals with edits made on certain cells in a datagridview (in this case called dgv Replenish).
I would like to refactor so that I can create unit tests to be able to test the logic that effects changing the back color of cells, and updating other cells.