Hey I need help with the data grid view control in VB.NET. I need to validate data input so it's <100 and >0. Also, need to restrict letters from being inputted. If anyone could help, please get in touch ASAP. It's a very very very small data set and your time will be rewarded.
There are problems trying to implement cell by cell validation using the grid's Validating event architecture. The problem is that the grid is not the object handling the data. Instead, a TextBox or some other control is the control managing the changing of the cell contents. One way to implement the validation at the grid level is to handle the CurrentCellChanged event, and if the previous cell's value is not proper, then return to that cell. You can download a sample that implements this process. The sample only handles the validation from cell to cell movement. If you want to handle the validation when the user clicks on the forms Close button, then you would have to add a special event handler for this and do one last validation at this point.