Back to Devexpress

ExcelFilteringDataEventArgs.AddData(Object, String, Boolean) Method

windowsforms-devexpress-dot-xtraeditors-dot-filtering-dot-excelfilteringdataeventargs-dot-adddata-x28-system-dot-object-system-dot-string-system-dot-boolean-x29.md

latest2.8 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public ExcelFilterDataItem AddData(
    object value,
    string text,
    bool htmlText = false
)
vb
Public Function AddData(
    value As Object,
    text As String,
    htmlText As Boolean = False
) As ExcelFilterDataItem

Parameters

NameTypeDescription
valueObject

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

NameTypeDefaultDescription
htmlTextBooleanFalse

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

|

Returns

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

csharp
if(e.Column == bcName) {
    e.AddData("Beetle", "<b>Coccinelle</b>", true);
}
vb
If e.Column = bcName Then
    e.AddData("Beetle", "<b>Coccinelle</b>", True)
End If

See Also

DataItems

ExcelFilteringDataEventArgs Class

ExcelFilteringDataEventArgs Members

DevExpress.XtraEditors.Filtering Namespace