A newer version of this page is available. Switch to the current version.

ExcelFilteringDataEventArgs.AddFilter(String, String, Boolean) Method

Adds the specified filter condition by which the column being processed can be filtered, and the corresponding text to be displayed in the filter popup.

Namespace: DevExpress.XtraEditors.Filtering

Assembly: DevExpress.XtraEditors.v19.1.dll

Declaration

public ExcelFilterItem AddFilter(
    string text,
    string criteriaString,
    bool htmlText = false
)

Parameters

Name Type Description
text String

The display text for the filter condition.

criteriaString String

The filter condition.

Optional Parameters

Name Type Default Description
htmlText Boolean

False

true, to enable HTML formatting for the text parameter; otherwise, false.

Returns

Type Description
DevExpress.XtraEditors.Filtering.ExcelFilterItem

An ExcelFilterItem object specifying the filter item.

Remarks

The AddFilter method adds a new item to the ExcelFilteringDataEventArgs.FilterItems collection. The code snippet below shows how to add a custom filter condition to the filter popup.


e.AddFilter("<image=A><nbsp>Automatic Transmission (6-speed)", "Contains([" + e.Column.FieldName + "], '6A')", true);

To learn how to compose criteria expressions, see Criteria Language Syntax.

See Also