Skip to main content
All docs
V25.1
  • FilterEditorControl.QueryOperands Event

    Allows you to customize a list of available operand types.

    Namespace: DevExpress.Xpf.Core.FilteringUI

    Assembly: DevExpress.Xpf.Grid.v25.1.dll

    NuGet Package: DevExpress.Wpf.Grid.Core

    Declaration

    public event EventHandler<QueryOperandsEventArgs> QueryOperands

    Event Data

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

    Property Description
    AllowDateTimeFunctionOperand Gets or sets whether to allow users to select date-time functions in the operand menu.
    AllowPropertyOperand Gets or sets whether to allow users to select properties in the operand menu.
    AllowValueOperand Gets or sets whether to allow users to select values in the operand menu.
    DefaultOperand Gets or sets an operand that is selected in the operand menu when users create a new filter condition.

    Remarks

    Run Demo: Filter Editor - Customize Operand Values

    <dxg:GridControl>
        <dxg:GridControl.Columns>
            <dxg:GridColumn FieldName="ProductName"/>
            <dxg:GridColumn FieldName="RequiredDate"/>
            <dxg:GridColumn FieldName="ShippedDate"/>
            <dxg:GridColumn FieldName="ShipCountry"/>
            <dxg:GridColumn FieldName="ShipCity"/>
            <dxg:GridColumn FieldName="ShipAddress"/>
        </dxg:GridControl.Columns>
        <dxg:GridControl.View>
            <dxg:TableView x:Name="view">
                <dxg:TableView.FilterEditorTemplate>
                    <DataTemplate>
                        <dxfui:FilterEditorControl QueryOperands="FilterEditorControl_OnQueryOperands" />
                    </DataTemplate>
                </dxg:TableView.FilterEditorTemplate>
            </dxg:TableView>
        </dxg:GridControl.View>
    </dxg:GridControl> 
    
    void FilterEditorControl_OnQueryOperands(object sender, QueryOperandsEventArgs e) {
        switch(e.FieldName) {
            case "RequiredDate":
            case "ShippedDate":
                e.AllowPropertyOperand = true;
                e.AllowDateTimeFunctionOperand = true;
                e.AllowValueOperand = true;
                break;
        }
    } 
    
    See Also