Skip to main content

ExcelFilteringDataEventArgs.AddFilter(String, CriteriaOperator, 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.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

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

Parameters

Name Type Description
text String

The display text for the filter condition.

criteria CriteriaOperator

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 more on how to create a criteria, refer to the Creating Criteria topic.

See Also