RadGrid for ASP.NET

RadGrid Send comments on this topic.
AllowPaging Property
See Also  Example
Telerik.WebControls Namespace > RadGrid Class : AllowPaging Property


Gets or sets a value indicating whether the automatic paging feature is enabled.   

 

Namespace: Telerik.WebControls
Assembly: RadGrid (in RadGrid.dll)

Syntax

Visual Basic (Declaration) 
Public Overridable Property AllowPaging As Boolean
Visual Basic (Usage)Copy Code
Dim instance As RadGrid
Dim value As Boolean
 
instance.AllowPaging = value
 
value = instance.AllowPaging
C# 
public virtual bool AllowPaging {get; set;}

Return Value

true if the paging feature is enabled; otherwise, false. The default is false

Example

The following code example demonstrates how to use the AllowPaging property to declaratively enable the paging feature in the Telerik RadGrid control.
Visual BasicCopy Code
<%@ Page Language="VB" %>

<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <rad:RadGrid
            DataSourceID="SqlDataSource1"
            ID="RadGrid1"
            runat="server"
            AllowPaging="true" >
        </rad:RadGrid>
        <!-- This example uses Microsoft SQL Server and connects -->
        <!-- to the Northwind sample database. Use an ASP.NET -->
        <!-- expression to retrieve the connection string value -->
        <!-- from the Web.config file. -->
        <asp:SqlDataSource
            ID="SqlDataSource1"
            runat="server"
            ConnectionString="<<see cref="NorthwindConnectionString">$ ConnectionStrings</see>>"
            SelectCommand="SELECT [CustomerID], [ContactName], [CompanyName] FROM [Customers]">
        </asp:SqlDataSource>
    </div>
    
</body>
</html>

Remarks

Instead of displaying all the records in the data source at the same time, the Telerik RadGrid control can automatically break the records up into pages. If the data source supports the paging capability, the Telerik RadGrid control can take advantage of that and provide built-in paging functionality. The paging feature can be used with any data source object that supports the System.Collections.ICollection interface or a data source that supports paging capability.

To enable the paging feature, set the AllowPaging property to true. By default, the Telerik RadGrid control displays 10 records on a page at a time. You can change the number of records displayed on a page by setting the PageSize property. To determine the total number of pages required to display the data source contents, use the PageCount property. You can determine the index of the currently displayed page by using the CurrentPageIndex property.

When paging is enabled, an additional item called the pager item is automatically displayed in the Telerik RadGrid control. The pager item contains controls that allow the user to navigate to the other pages. You can control the settings of the pager item by using the PagerItemStyle property. The pager item can be displayed at the top, bottom, or both the top and bottom of the control by setting the Position property. You can also select from one of four built-in pager display modes by setting the Mode property.

The Telerik RadGrid control also allows you to define a custom template for the pager item.

Requirements

Supported in: 3.0, 2.0, 1.1, 1.0 .NET Framework

See Also

Reference

RadGrid Class
RadGrid Members

Custom Paging

AllowCustomPaging Property

Telerik RadGrid Manual

Basic Paging