Skip to main content

ExcelFilteringDataEventArgs.AddData(Object, String, Boolean) Method

Adds the specified data value 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.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public ExcelFilterDataItem AddData(
    object value,
    string text,
    bool htmlText = false
)

Parameters

Name Type Description
value Object

The data value by which the column can be filtered.

text String

The text of the filter condition to be displayed in the filter popup.

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.ExcelFilterDataItem

An ExcelFilterDataItem object specifying the filter item.

Remarks

The AddData method adds a new item to the ExcelFilteringDataEventArgs.DataItems collection. The code snippet below shows how to add custom string data by which the column can be filtered, and the corresponding display text for a particular column.

if(e.Column == bcName) {
    e.AddData("Beetle", "<b>Coccinelle</b>", true);
}
See Also