ColumnView.SetColumnError(GridColumn, String, ErrorType) Method
Sets an error description and an error type for the specified cell within the focused row.
Namespace: DevExpress.XtraGrid.Views.Base
Assembly: DevExpress.XtraGrid.v24.2.dll
NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation
#Declaration
public virtual void SetColumnError(
GridColumn column,
string errorText,
ErrorType errorType
)
#Parameters
Name | Type | Description |
---|---|---|
column | Grid |
A Grid |
error |
String | A string value representing an error description. An empty string to clear the assigned error. |
error |
Error |
An Error |
#Remarks
This method overload allows you to set an error of a specific error type for a cell within the focused row. Generally, you may need to set errors to cells while performing data validation via the ColumnView.ValidateRow event.
When an error is set to a cell, an error icon is automatically displayed. Its type is specified by the errorType parameter.
If a View’s data source is a DataView or a DataTable, you can set errors for individual rows using the SetColumnError method of data rows. The View will also mark these rows with the error icon. Note however, that methods provided by the ColumnView class do not allow you to work with such errors. Instead, use members provided by the DataRow object to handle errors assigned in this manner.
In order to provide error support for IList data sources, you need to implement the IDataErrorInfo or IDXDataErrorInfo interface. Refer to the Implementing ErrorInfo Support for Data Sources document for details.
The SetColumnError method does not set errors for fields displayed in the edit form when the GridOptionsEditForm.BindingMode option is set to Cached.
Note
Detail pattern Views do not contain data and they are never displayed within Xtra
- Grid
Control. - returns the top most View in a grid;Main View - Grid
Control. - returns the focused View;Focused View - Grid
Control. - returns the currently maximized View;Default View - the sender parameter of View specific events;
- Grid
View. - returns a detail clone View for a specific master row.Get Detail View