Datagridview validating event
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.For example, this event triggers everytimes the users switches to another row.However, when I click on the button to open the child window and close it back, the Data Grid View becomes just a white box with a diagonal cross, and a Null Reference Exception shows. If not, what's the best way to validate a value of the cell and which event to put it in?What's the best place to implement validation logic code and conditional formatting code for a Data Grid View?
Meanwhile, we can use the Validate Row event in the same way to prevent the user from exiting the current row.When you display data entry functionality to users, you frequently have to validate the data entered into your form.The Data Grid View class provides a convenient way to perform validation before data is committed to the data store.Is there a way to change the dgv cell Style Format and cell Tag from within the Cell Validating event?I've tried a few things and have searched for answers without luck so far.