GridView::PageSize Property

 

Gets or sets the number of records to display on a page in a GridView control.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public:
property int PageSize {
	virtual int get();
	virtual void set(int value);
}

Property Value

Type: System::Int32

The number of records to display on a single page. The default is 10.

Exception Condition
ArgumentOutOfRangeException

The PageSize property is set to a value less than 1.

When the paging feature is enabled (by setting the AllowPaging property to true), use the PageSize property to specify the number of records to display on a single page.

The following example demonstrates how to use the PageSize property to display 15 records at a time in a GridView control.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: