Currently, I have a DataGrid which is bound to some data in my ViewModel. I have ValidationRules set up for the Rows, and the Columns. What I would like to do is prevent the user from saving the file if there are any Validation Errors. I am using the RelayCommands class to route the Open, Save, etc commands to my ViewModel.
Prevent Save when Validation Errors occur on WPF DataGrid
6.1k views Asked by s73v3r At
2
There are 2 answers
0
On
You might be interested in the BookLibrary sample application of the WPF Application Framework (WAF). It disables the Save button when a validation error is active (e.g. DataGrid).
Check the below links
Disable Save button in WPF if validation fails
Using WPF Validation rules and disabling a 'Save' button
http://babaandthepigman.wordpress.com/2010/02/14/wpf-commanding-and-data-annotations-validation/
Hope this helps...