Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
145
Only Validate IDataErrorInfo on Visible Rows in UltraGrid
posted

Is there a way to only validate IDataErrorInfo errors on visible rows on an UltraGrid? When I implement the Error property on a custom object that implements IDataErrorInfo, that property is getting called for every row in the grid when I mouse over the grid. This is fine for a grid with a few dozen rows, but when the grid contains several thousands rows, the grid is unusable. I've provided the implementation of the Error property below. Any ideas?

public virtual string Error

{
get
{
StringBuilder error = new StringBuilder();

var results = new List<ValidationResult>();

bool valid = Validator.TryValidateObject(this,
new ValidationContext(this, null, null),
results, true);

foreach (ValidationResult result in results)
{
error.AppendLine(result.ErrorMessage);
}

return error.ToString();
}
}

Parents Reply Children
No Data