Skip to main content

DxGrid.PagerSwitchToInputBoxButtonCount Property

Specifies the number of pages when the pager switches from numeric buttons to the input box in Auto mode.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(11)]
[Parameter]
public int PagerSwitchToInputBoxButtonCount { get; set; }

Property Value

Type Default Description
Int32 11

Specifies the number of pages when the pager switches to the input box.

Remarks

When the PagerNavigationMode property is set to Auto (the default value), the pager displays the input box in the following cases:

  • The total number of pages is greater than or equal to the PagerSwitchToInputBoxButtonCount value.
  • The Grid is displayed on small devices. In this case, the PagerSwitchToInputBoxButtonCount value is ignored.

In other cases, the pager displays numeric buttons.

The following example enables the input box when the number of pages is greater than or equal to 5.

@using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory
@implements IDisposable

<DxGrid Data="@Data"
        PagerSwitchToInputBoxButtonCount="5"
        PageSizeSelectorVisible="true"
        PageSizeSelectorItems="@(new int[] { 5, 10, 15 })">
    <Columns>
        <DxGridDataColumn FieldName="ShipName" />
        <DxGridDataColumn FieldName="ShipCity" />
        <DxGridDataColumn FieldName="ShipCountry" />
        <DxGridDataColumn FieldName="Freight" />
        <DxGridDataColumn FieldName="OrderDate" />
        <DxGridDataColumn FieldName="ShippedDate" />
    </Columns>
</DxGrid>

@code {
    object Data { get; set; }
    NorthwindContext Northwind { get; set; }

    protected override void OnInitialized() {
        Northwind = NorthwindContextFactory.CreateDbContext();
        Data = Northwind.Orders.Take(50).ToList();
    }

    public void Dispose() {
        Northwind?.Dispose();
    }
}

Blazor Grid Pager Switch to Input Box

Run Demo: Data Grid - Paging

For more information about paging in the Grid component, refer to the following topic: Paging in Blazor Grid.

See Also