user3428422
user3428422

Reputation: 4560

WPF DataGrid on validation error, how to disable buttons on view

I have set up my own ValidationRule so when some validation fails inside a Datagrid, an error appears and you need to correct that error to continue to edit the rest of the grid.

Perfect.

However, you can still "Save" with this error still present. Is there a way I can disable a button if validation fails?

My button is an Command, so therefore I could set "CanExecute" to be false. However this is in my ViewModel so I dont know how to do this.

I can paste my code, but theres a lot of classes plus xaml here which will flood the question, if you have an idea how to do this, I will obviously paste code which is relevant.

Many Thanks Thanks!

Upvotes: 1

Views: 1223

Answers (0)

Related Questions