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.2.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 | Criteria |
The filter condition. |
#Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
html |
Boolean | False | true, to enable HTML formatting for the text parameter; otherwise, false. |
#Returns
Type | Description |
---|---|
DevExpress. |
An Excel |
#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.