What's the best place to implement validation logic code and conditional formatting code for a Data Grid View?
In a lot of books and articles that I've read on this control, it seems to suggest that the appropriate event to handle for this is the Cell Validating one. However, this event triggers a bit too often for my tastes and I'm not sure it is required.
I have tried the below code on datagrid View Cellvalidation event but its not working.
I want that whenever user presses anyother key than a number key(ex:1,2,3,4....)than immediately i should get a messagebox that only numbers allowed.
Please suggest on what event and how can i do such validation.
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.