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

DxGrid.CustomizeFilterRowEditor Event

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

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[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.

Razor
<DxGrid Data="GridData"
        ShowFilterRow="true"
        CustomizeFilterRowEditor="Grid_CustomizeFilterRowEditor">
    <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