In my CellValidating Event I am passing the "GridViewCellValidatingEventArgs e" object to a WCF Service Call to compare the field value against a list of valid options in a DB Table.
When the Async process completes (WebService_ValidateColACompleted(object sender, ValidateColACompletedEventArgs e) event) and returns back a Boolean value to indicate the success, if the validation succeeds (e.Result == true), the functionality is field value is left as-is since it is valid.
If the validation fails (e.Result == false), then I am using the e.UserState to reference the original GridViewCellValidatingEventArgs object and am doing the following:
GridViewCellValidatingEventArgs eOrig = ((GridViewCellValidatingEventArgs)e.UserState);
eOrig.ErrorMessage = "Validation failed.";
eOrig.IsValid = false;
Stepping through the code, the ErrorMessage and IsValid values are being updated, but the field in the grid is not turning red or showing the error.
I am assuming this is due to the Asynchronous call, but would like to know a good solution to this issue.