Validation of your data is a requirement for almost every application in order to make sure that no invalid input is possible. If you're using a
DataGrid, then you can easily implement validation by using data annotations on your classes or properties. This control picks up these validation rules automatically and even provides visual feedback. In this recipe, you'll learn how to get your
DataGrid to implement this kind of validation.
You can find a starter solution for this recipe located in the
Chapter05\DataGrid_Validation_Starter folder in the code bundle that is available on the Packt website. The finished solution for this recipe can be found in the