Back to Devexpress

ASPxGridBase.PageIndex Property

aspnet-devexpress-dot-web-dot-aspxgridbase-5c183b3f.md

latest6.0 KB
Original Source

ASPxGridBase.PageIndex Property

Gets or sets the index of the page currently being selected.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(0)]
public int PageIndex { get; set; }
vb
<DefaultValue(0)>
Public Property PageIndex As Integer

Property Value

TypeDefaultDescription
Int320

An integer value that specifies the active page’s index.

|

Remarks

Find control-specific information (for ASPxGridView, ASPxCardView or ASPxVerticalGrid) in the sections below.

ASPxGridView

Use the PageIndex property to switch between pages in code.

If the PageIndex property is set to -1 , the grid displays the content of all pages within its view (the PagerSettingsEx.AllButton mode).

Note

If the ASPxGridViewPagerSettings.Mode property is set to EndlessPaging , use the ASPxGridBase.ResetToFirstPage method to switch the grid to the first page.

ASPxGridViewPagerSettings.Mode

ASPxClientGridView.GetPageIndex

Grid View - Get Started

Code Central Example: How to implement the multi-row editing feature in the ASPxGridView

ASPxCardView

Use the PageIndex property to switch between pages in code.

If the PageIndex property is set to -1 , the grid displays the content of all pages within its view (the PagerSettingsEx.AllButton mode).

Note

If the ASPxCardViewPagerSettings.Mode property is set to EndlessPaging , use the ASPxGridBase.ResetToFirstPage method to switch the grid to the first page.

ASPxCardViewPagerSettings.Mode

ASPxClientCardView.GetPageIndex

Card View - Get Started

ASPxVerticalGrid

Use the PageIndex property to switch between pages in code.

If the PageIndex property is set to -1 , the grid displays the content of all pages within its view (the PagerSettingsEx.AllButton mode).

ASPxVerticalGridPagerSettings.Mode

ASPxClientVerticalGrid.GetPageIndex

Vertical Grid - Get Started

The following code snippets (auto-collected from DevExpress Examples) contain references to the PageIndex property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-web-forms-grid-cache-data-on-the-client-side/CS/Solution/Default.aspx.cs#L8

csharp
protected void grid_CustomJSProperties(object sender, ASPxGridViewClientJSPropertiesEventArgs e) {
    int startIndex = grid.PageIndex * grid.SettingsPager.PageSize;
    int end = Math.Min(grid.VisibleRowCount, startIndex + grid.SettingsPager.PageSize);

web-forms-pivot-grid-obtain-underlying-data/CS/ASPxPivotGrid_DisplayUnderlyingRecords/Default.aspx.cs#L20

csharp
{
    ASPxGridView1.PageIndex = 0;
    ASPxGridView1.JSProperties["cpShowDrillDownWindow"] = true;

asp-net-web-forms-grid-cache-data-on-the-client-side/VB/Solution/Default.aspx.vb#L13

vb
Protected Sub grid_CustomJSProperties(ByVal sender As Object, ByVal e As ASPxGridViewClientJSPropertiesEventArgs)
    Dim startIndex As Integer = grid.PageIndex * grid.SettingsPager.PageSize
    Dim [end] As Integer = Math.Min(grid.VisibleRowCount, startIndex + grid.SettingsPager.PageSize)

web-forms-pivot-grid-obtain-underlying-data/VB/ASPxPivotGrid_DisplayUnderlyingRecords/Default.aspx.vb#L19

vb
If Equals(e.Parameters, "D") Then
    ASPxGridView1.PageIndex = 0
    ASPxGridView1.JSProperties("cpShowDrillDownWindow") = True

See Also

ASPxGridBase Class

ASPxGridBase Members

DevExpress.Web Namespace