Skip to main content
A newer version of this page is available. .

DxGrid.PagerVisible Property

Specifies whether the Grid displays the pager.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(true)]
[Parameter]
public bool PagerVisible { get; set; }

Property Value

Type Default Description
Boolean true

true to display the pager; otherwise, false.

Remarks

Our Blazor Grid splits a large amount of data rows across multiple pages. The pager allows users to navigate between pages.

The Grid does not display the pager in the following cases:

  • The number of rows is less than or equal to the PageSize value and the page size selector is hidden.
  • You enable the ShowAllRows option to display all rows on one page and do not add the All item to the page size selector.

You can disable the PagerVisible property to hide the pager in other cases.

To customize the pager appearance, handle the CustomizeElement event.

The following example hides the built-in pager and uses an external DxPager component:

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

<DxPager @bind-ActivePageIndex="@PageIndex"
         PageCount="10" />
<br/>

<DxGrid Data="@Data"
        PagerVisible="false"
        @bind-PageIndex="@PageIndex">
    <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; }
    int PageIndex { get; set; } = 0;

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

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

Blazor Grid External Pager

Run Demo: Data Grid - Paging

Implements

See Also