Back to Devexpress

ASPxGridBase.FilterControlCustomValueDisplayText Event

aspnet-devexpress-dot-web-dot-aspxgridbase-ebc164c6.md

latest4.1 KB
Original Source

ASPxGridBase.FilterControlCustomValueDisplayText Event

Allows you to specify the entered filter value’s custom display text to be displayed when the filter control’s condition value editor is inactive.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public event FilterControlCustomValueDisplayTextEventHandler FilterControlCustomValueDisplayText
vb
Public Event FilterControlCustomValueDisplayText As FilterControlCustomValueDisplayTextEventHandler

Event Data

The FilterControlCustomValueDisplayText event's data class is FilterControlCustomValueDisplayTextEventArgs. The following properties provide information specific to this event:

PropertyDescription
DisplayTextGets or sets the display text of the entered filter value.
EncodeHtmlGets or sets a value that specifies whether the filter value display text keeps any of its values that are HTML as HTML, or instead, strips out the HTML markers.
PropertyInfoGets the filterable property of the filter expression.
ValueGets the custom value entered into the filter bar by an end user.

Remarks

The FilterControlCustomValueDisplayText event enables you to provide a custom display text for the filter value entered into the built-in filter control’s filter condition. This custom text is displayed within a condition value editor when it’s inactive.

The event’s Value property allows the currently entered value to be obtained. Set the DisplayText property to specify the value’s custom display text, if required.

csharp
protected void grid_FilterControlCustomValueDisplayText(object sender, FilterControlCustomValueDisplayTextEventArgs e) {
    if (e.PropertyInfo.PropertyName == "NeedAlert") {
        if (e.Value == null)
            return;
        e.DisplayText = (bool)e.Value ? "Need alert" : "Is's ok";
    }
}
vb
Protected Sub grid_FilterControlCustomValueDisplayText(ByVal sender As Object, ByVal e As FilterControlCustomValueDisplayTextEventArgs)
    If e.PropertyInfo.PropertyName = "NeedAlert" Then
        If e.Value Is Nothing Then
            Return
        End If
        e.DisplayText = If(CBool(e.Value), "Need alert", "Is's ok")
    End If
End Sub

Run Demo: Grid - Filter ControlRun Demo: Card View - Filter ControlRun Demo: Vertical Grid - Filter Control

See Also

Grid - Filter Control

Card View - Filter Control

Vertical Grid - Filter Control

ASPxGridBase Class

ASPxGridBase Members

DevExpress.Web Namespace