Share via


ItemsPerPage Property

Sets or returns the number of items displayed per page after pagination.

public int ItemsPerPage {
   get,
   set
}

Remarks

If zero, pagination is not affected by this property. If nonzero, overrides items displayed per page when the form is paginated. The default value is zero.

Mobile controls that support internal pagination also provide a feature called custom pagination. Normally, such controls require you to provide them all the data that they can display. Developers specify the total number of items that are in the list in the ItemCount property. The ItemsPerPage property specifies how many items the control displays per page.

Example

The following example demonstrates how to use the ItemsPerPage property to render 20 items per page for List1 and 25 items per page for List2.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  
If Not IsPostBack Then
   
If Not IsPostBack Then
   List1.ItemsPerPage = 20
   List2.ItemsPerPage = 25
   Dim i As Integer
   For i = 0 To 99
      List1.Items.Add(("List1 Item" + i.ToString()))
      List2.Items.Add(("List2 Item" + i.ToString()))
   Next i
End If
   
End If

End Sub

[C#]

public void Page_Load(Object sender, EventArgs e)
{
   if (!IsPostBack)
   {
      List1.ItemsPerPage = 20;
      List2.ItemsPerPage = 25;
      for (int i = 0; i < 100; i++)
      {
         List1.Items.Add("List1 Item" + i);
         List2.Items.Add("List2 Item" + i);
      }
   }
}

See Also

Applies to: PagedControl Class | Pagination | Working With Deck Size Limits