Back to Devexpress

DxGrid.CustomizeFilterRowEditor Event

blazor-devexpress-dot-blazor-dot-dxgrid-9f24aa8f.md

latest3.4 KB
Original Source

DxGrid.CustomizeFilterRowEditor Event

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

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

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

Parameters

TypeDescription
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.

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

DxGrid Class

DxGrid Members

DevExpress.Blazor Namespace