C datagridview cellvalidating example

From within that event, you can indicate that the user's value is invalid by setting the Error Text value of the cell or row.

for the same row, I want to keep the checkbox column unchanged (it remains with its old value, for example if it was unchecked and user checks it, it will remain unchecked).

Is there a way to change the dgv cell Style Format and cell Tag from within the Cell Validating event?

For example, this event triggers everytimes the users switches to another row.

On the other hand, the Cell Value Changed event seems to trigger only when the value of the cell changes, which means the validation code runs only when the value changes and not everytime a user changes cells.

The rest of the cell validations are perfectly working!

How am i supposed to edit the code so that it does not generate this error?

763

Leave a Reply