views:

239

answers:

1

Using the WPF datagrid from WPFToolkit I want to show errors only during the save operation. Currently it seems to validate when you move off the row, hit enter, etc.

There are two types of row level validations I need to perform:

1) Before service call to ensure fields on object are set.

2) After service call, to show any service validation. (Note I have a way to map the service validation to the object that was sent - but need a way to highlight the row error with the service validation)

Seems to be two options: a) use default ValidationRule WPF grid framework to highlight the before/after row validations by forcing validation to be rerun somehow? b) roll my own validation

My question is there a way to do row level validations on multiple rows manually?

A: 

If you are binding to an INotifyProperty you can manually call PropertyChanged(propertyName) to force a re-validation. Since you're using a DataGrid, you might need to use CollectionChanged() instead.

vanja.