Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

FilterEditorControl.QueryOperands Event

Allows you to customize a list of available operand types.

Namespace: DevExpress.Xpf.Core.FilteringUI

Assembly: DevExpress.Xpf.Grid.v24.2.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