Skip to main content
All docs
V23.2

DxGrid.CustomizeFilterRowEditor Event

Allows you to customize a cell editor in the filter row.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public Action<GridCustomizeFilterRowEditorEventArgs> CustomizeFilterRowEditor { get; set; }

Parameters

Type Description
GridCustomizeFilterRowEditorEventArgs

An object that contains data for this event.

Remarks

The Grid generates and configures cell editors for individual columns based on associated data types. You can use the EditSettings property to customize a column’s editor settings. The Grid displays these cell editors in the filter row and in data rows during edit operations.

Edit Row and Filter Row

Handle the CustomizeFilterRowEditor event to customize filter row editors separately from data row editors.

<DxGrid Data="GridData"
        ShowFilterRow="true"
        CustomizeFilterRowEditor="Grid_CustomizeFilterRowEditor"
        SizeMode="Params.SizeMode" KeyboardNavigationEnabled="Params.KeyboardNavigationEnabled">
    <Columns>
        <DxGridDataColumn FieldName="OrderId" Caption="Order ID" DisplayFormat="d" SortIndex="0" MinWidth="100" Width="10%" />
        <DxGridDataColumn FieldName="OrderDate" DisplayFormat="d" MinWidth="120" Width="10%" />
        <DxGridDataColumn FieldName="ProductName" FilterRowValue='"Queso"' FilterRowOperatorType="GridFilterRowOperatorType.Contains" MinWidth="100" />
        <DxGridDataColumn FieldName="UnitPrice" DisplayFormat="c2" MinWidth="150" Width="10%">
            <FilterRowCellTemplate>
                <DxComboBox @bind-Value="context.FilterCriteria"
                            Data="UnitPriceIntervals" ValueFieldName="Criteria" TextFieldName="DisplayText"
                            ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto" />
            </FilterRowCellTemplate>
        </DxGridDataColumn>
        <DxGridDataColumn FieldName="CustomerId" Caption="Customer" MinWidth="120">
            <EditSettings>
                <DxComboBoxSettings Data="Customers" ValueFieldName="CustomerId" TextFieldName="DisplayText" FilteringMode="DataGridFilteringMode.Contains" />
            </EditSettings>
        </DxGridDataColumn>
        <DxGridDataColumn FieldName="Shipped" UnboundType="GridUnboundColumnType.Boolean" UnboundExpression="[ShippedDate] <> Null" Width="5%" MinWidth="100" />
        <DxGridCommandColumn Width="80px" NewButtonVisible="false" EditButtonVisible="false" DeleteButtonVisible="false" />
    </Columns>
</DxGrid>

@code {
    // ...
    void Grid_CustomizeFilterRowEditor(GridCustomizeFilterRowEditorEventArgs e) {
        if(e.FieldName == "OrderId" || e.FieldName == "OrderDate"){
            var EditorSettings = e.EditSettings as ITextEditSettings; 
            EditorSettings.ClearButtonDisplayMode = DataEditorClearButtonDisplayMode.Never;
        }
    }
}
See Also