Skip to main content
All docs
V25.2
  • GridFilterPanelDisplayMode Enum

    Lists values that specify filter panel visibility.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.2.dll

    Declaration

    public enum GridFilterPanelDisplayMode

    Members

    Name Description
    Never

    The filter panel is hidden.

    Always

    The filter panel is always visible.

    Auto

    The filter panel appears when data is filtered (otherwise, the panel is hidden).

    Remarks

    The Grid component ships with an integrated filter panel. This panel includes the following elements:

    • The filter toggle that allows users to temporarily deactivate the filter.
    • The current filter condition. Users can click it to open the filter builder dialog and customize the filter.
    • The Clear Filter button.

    DevExpress Blazor Grid - Filter Panel

    Read Tutorial: Filter Panel and Filter Builder Run Demo: Filter Panel

    Assign Auto to FilterPanelDisplayMode to display the filter panel only when Grid data is filtered. The panel remains visible after the filter is temporarily deactivated (disappears only after the filter is cleared).

    To display the filter panel permanently, set the FilterPanelDisplayMode property to Always:

    @inject NwindDataService NwindDataService
    
    <DxGrid @ref="Grid"
            Data="Data"
            FilterMenuButtonDisplayMode="GridFilterMenuButtonDisplayMode.Always"
            FilterPanelDisplayMode="GridFilterPanelDisplayMode.Always">
        <Columns>
            <DxGridDataColumn FieldName="SalesPerson" Caption="Salesperson" />
            <DxGridBandColumn Caption="Order">
                <Columns>
                    <DxGridDataColumn FieldName="CompanyName" />
                    <DxGridDataColumn FieldName="OrderDate" Caption="Date" />
                    <DxGridBandColumn Caption="Product">
                        <Columns>
                            <DxGridDataColumn FieldName="ProductName" Caption="Name" />
                            <DxGridDataColumn FieldName="UnitPrice" DisplayFormat="c"
                                              CaptionAlignment="GridTextAlignment.Right" />
                        </Columns>
                    </DxGridBandColumn>
                    <DxGridDataColumn FieldName="Quantity" />
                </Columns>
            </DxGridBandColumn>
        </Columns>
    </DxGrid>
    
    @code {
        object Data { get; set; }
        IGrid Grid { get; set; }
    
        protected override async Task OnInitializedAsync() {
            var invoices = await NwindDataService.GetInvoicesAsync();
            var customers = await NwindDataService.GetCustomersAsync();
            Data = invoices.OrderBy(i => i.OrderDate).Join(customers, i => i.CustomerId, c => c.CustomerId,
                (i, c) => { return new {
                    CompanyName = c.CompanyName,
                    SalesPerson = i.Salesperson,
                    UnitPrice = i.UnitPrice,
                    OrderDate = i.OrderDate,
                    ProductName = i.ProductName,
                    Quantity = i.Quantity
                };
            });
        }
        protected override Task OnAfterRenderAsync(bool firstRender) {
            if (firstRender)
                Grid.SetFilterCriteria(CriteriaOperator.Parse("[UnitPrice] > 100M" +
                                                      "And ([SalesPerson] In ('Robert King', 'Andrew Fuller')" +
                                                      "Or [CompanyName] == 'Ernst Handel')"));
            return base.OnAfterRenderAsync(firstRender);
        }
    }
    
    See Also