Skip to main content
Tab

GridViewTemplates.PagerBar Property

Specifies a template to display the pager.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.2.dll

Declaration

[DefaultValue(null)]
public virtual ITemplate PagerBar { get; set; }

Property Value

Type Default Description
ITemplate null

An object that implements the ITemplate interface.

Remarks

When you specify the PagerBar property, the grid control creates a template within a container object of the GridViewPagerBarTemplateContainer type.

Refer to the Create Templates topic for information on how to create templates for the Grid View control’s elements.

Example

In the example below, the pager bar template contains the Prev and Next buttons to navigate the control pages. PagerBar

<dx:ASPxGridView ID="grid" runat="server" AutoGenerateColumns="false">
    <Templates>
        <PagerBar>
            <table style="width: 50%">
                <tr>
                    <td style="padding-left: 8px;">
                        <dx:ASPxButton runat="server" ID="PrevButton" Text="Prev"
                            Enabled="<%# Container.Grid.PageIndex > 0 %>"
                            AutoPostBack="false" UseSubmitBehavior="false">
                            <ClientSideEvents Click="function() { grid.PrevPage() }" />
                        </dx:ASPxButton>
                    </td>
                    <td>
                        <dx:ASPxButton runat="server" ID="NextButton" Text="Next"
                            Enabled="<%# Container.Grid.PageIndex < Container.Grid.PageCount - 1 %>"
                            AutoPostBack="false" UseSubmitBehavior="false">
                            <ClientSideEvents Click="function() { grid.NextPage() }" />
                        </dx:ASPxButton>
                    </td>
                </tr>
        </PagerBar>
    </Templates>
</dx:ASPxGridView>

Online Example

View Example: How to create a custom pager and display a page size item

See Also