ComponentOne Grid for WPF: Data Validation > Validating Cell Input > Improving IDataErrorInfo Performance Using the IQuickDataErrorInfo Interface

Improving IDataErrorInfo Performance Using the IQuickDataErrorInfo Interface

If data source items implement the IDataErrorInfo interface, C1DataGrid needs to check if errors are present for each grid column via the interface. This may bring performance penalties that can vary depending on implementation details. The IQuickDataErrorInfo interface can help improve performance.

The IQuickDataErrorInfo interface extends the IDataErrorInfo interface (which it's derived from) by adding a single Boolean property named HasErrors. HasErrors, as you might expect, indicates whether at least one error is present on the item. If HasErrors returns False, the grid doesn't need to retrieve errors for each column's underlying property, making processing far faster.

To improve the C1DataGrid control's grid performance, you might consider implementing the IQuickDataErrorInfo interface instead of (or in addition to) the IDataErrorInfo interface in your custom item class.


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.