In the following example, the CustomFilterDisplayText event is handled to display "No Filter" in the filter panel when the control's data is not filtered.
If the control's data is not filtered, the ConvertEditValueEventArgs.Value event parameter is set to null (Nothing in VB). In this instance, the custom display text that needs to be displayed in the filter panel is assigned to this parameter.
If the control's data is filtered, the ConvertEditValueEventArgs.Value event parameter specifies a valid DevExpress.Data.Filtering.CriteriaOperator object, which represents the current data filter. In this instance, the example illustrating the textual representation of the current filter is assigned to the ConvertEditValueEventArgs.Value parameter. Alternatively, you can check the current DevExpress.Data.Filtering.CriteriaOperator object to provide custom display text depending upon the current filter.
The result for a sample vertical grid control is displayed below.

C# |
private void vGridControl1_CustomFilterDisplayText(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e) {
if (e.Value == null) {
e.Value = "No Filter";
}
else {
e.Value = e.Value.ToString();
}
e.Handled = true;
}
|
VB |
Private Sub VGridControl1_CustomFilterDisplayText(sender As Object, e As DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs) Handles VGridControl1.CustomFilterDisplayText
If e.Value Is Nothing Then
e.Value = "No Filter"
Else
e.Value = e.Value.ToString()
End If
e.Handled = True
End Sub
|