Back to Devexpress

GridViewTemplates.PagerBar Property

aspnet-devexpress-dot-web-dot-gridviewtemplates-05b3bfa9.md

latest3.1 KB
Original Source

GridViewTemplates.PagerBar Property

Specifies a template to display the pager.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(null)]
public virtual ITemplate PagerBar { get; set; }
vb
<DefaultValue(Nothing)>
Public Overridable Property PagerBar As ITemplate

Property Value

TypeDefaultDescription
ITemplatenull

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.

aspx
<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

GridViewTemplates Class

GridViewTemplates Members

DevExpress.Web Namespace