When the cell is then "corrected" with an acceptbile value (basis Metadata), the cell correctly removes the highlight indicator however validation summary is not being updated (cleared).
In the event I'm missing something, I didn't want to log a bug.
I'm on version 2011.01.315.0
Thanks.
5 Answers, 1 is accepted
May you share a bit more information about the exact scenario you are trying to achieve ? What exactly do you refer to as "validation summary", is it something like the one in our demos for RowValidation?
If yes, please take a look at the code-behind - there the errors in the validation summary are cleared on RowValidated event:
void radGridView_RowValidated(object sender, Telerik.Windows.Controls.GridViewRowValidatedEventArgs e)
{
this.validationSummary.Errors.Clear();
foreach (GridViewCellValidationResult valResult in e.ValidationResults)
{
}
}
Regards,
Maya
the Telerik team

The components involved are the RadDataGrid, and a generic Silverlight ValidationSummary from the SDK. The first column in the grid is a "quantity" field with associated validation metadata on the WCF RIA side. I've attached screenshots of the conditions.
If the cell has a value (e.g. 5), we have a validation and the screen is clear.
If I edit that cell with a value (e.g. change 5 to AAA), tab to the next field, we have a failed validation and the cell turns RED with information and the error is listed into the ValidationSummary. This is done without code and asynchronously. The row is still in the editing state. Only the current cell has been changed.
If I then correct the cell with a value (e.g. change AAA back to 5), still within the same editing row, the cell asynchronously updates, the RED border disappears. However the error remains within the SummaryValidation.
I guess I am surprised I would have to explicitly remove the error on a subsequent "positive" validation as I didn't have to explicitly add it.
I've tried the following code as provided in the demo, however the condition remains:
private void dg_tblPOLines_RowValidated(object sender, GridViewRowValidatedEventArgs e)
{
this.valSummary.Errors.Clear();
foreach (GridViewCellValidationResult valResult in e.ValidationResults)
{
GridViewCell errorCell = e.Row.GetCellFromPropertyName(valResult.PropertyName);
ValidationSummaryItemSource validationSummaryItemSource = new ValidationSummaryItemSource(valResult.PropertyName, errorCell);
this.valSummary.Errors.Add(new ValidationSummaryItem(valResult.ErrorMessage, string.Empty, ValidationSummaryItemType.ObjectError,
validationSummaryItemSource, e.Row.DataContext));
}
}
Thanks,
Mark
In the scenario you described, the validation is handled by the Framework and it fails at cell level, not when the whole row is validated. Consequently, you may try to execute a similar code in the CellValidated event. I am sending you a sample project illustrating the suggested approach. Please take a look at it and let me know whether it corresponds to your scenario.
Maya
the Telerik team

Thank you for your efforts, unfortunately this doesn't resolve the issue. If you'll try your sample, you'll see that the cell validation is removed from the validation summary, however the overall validation summary "notice" is still evident until the row validates at which point the validation is cleared and removed from the UI.
The standard SL SDK datagrid required none of this additional plumbing and I find it surprising and frankly counterproductive that from the coding perspective I need to address this so granularly. If it is a function of the additional abilities provided by the telerik grid (which I certain agree is superior) than so be it.
It just seems to be significantly "more" work not less to implement validation in your control.
You are quite correct. This behavior is observed as no matter if there is an error or not, such is being added to the validation summary items source. What you may do is to slightly change the implementation of the CellValidated event:
void clubsGrid_CellValidated(object sender, GridViewCellValidatedEventArgs e)
{
this.validationSummary.Errors.Clear();
GridViewCell errorCell = (e.Cell.ParentRow as GridViewRow).GetCellFromPropertyName(e.ValidationResult.PropertyName);
ValidationSummaryItemSource validationSummaryItemSource = new ValidationSummaryItemSource(e.ValidationResult.PropertyName, errorCell);
if (validationSummaryItemSource.Control != null)
{
this.validationSummary.Errors.Add(new ValidationSummaryItem(e.ValidationResult.ErrorMessage, string.Empty,
ValidationSummaryItemType.ObjectError,
validationSummaryItemSource, (e.Cell.ParentRow as GridViewRow).DataContext));
}
}
Let me know whether it corresponds to your requirements.
Kind regards,
Maya
the Telerik team