C datagridview cellvalidating

In my case, Cell Value Changed has done what I wanted/needed.

If it is less than five characters, you set the Error Text property of that cell to some error message.I have not noticed much in the way of a performance hit (tested with 100 - 5000 rows).I think in the end it depends on what your validation needs are.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.

Leave a Reply