After I make any changes to a DataGrid programatically, I call this function I wrote. It will check for any validation errors and inform the user if they exist so that they can be corrected. Otherwise, it will silently persist the changes in the background. I'm not sure what you mean by "waiting/loading popup". The only indication is the small blue spinner next to the screen name on the tab for a second or two.
private void ValidateAndSave()
{
//Check for validation errors
if ((this.Details.ValidationResults.HasErrors == false)) {
//Save the changes to the database
try {
this.DataWorkspace.DatabaseNameData.SaveChanges();
} catch (Exception ex) {
this.ShowMessageBox(ex.ToString());
}
} else {
//If validation errors exist,
string res = "";
//Add each one to a string,
foreach (object msg_loopVariable in this.Details.ValidationResults) {
msg = msg_loopVariable;
res = res + msg.Property.DisplayName + ": " + msg.Message + "\r\n";
}
//And display them in a message box
this.ShowMessageBox(res, "Validation error", MessageBoxOption.Ok);
}
}
Note: I converted this from VB.NET so it's probably not a drop in replacement. In particular I think the Message Box is done differently so double check that.