Επεξεργασία

Κοινή χρήση μέσω


GridView.AllowCustomPaging Property

Definition

Gets or sets a value that indicates whether custom paging is enabled.

public:
 virtual property bool AllowCustomPaging { bool get(); void set(bool value); };
public virtual bool AllowCustomPaging { get; set; }
member this.AllowCustomPaging : bool with get, set
Public Overridable Property AllowCustomPaging As Boolean

Property Value

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

Remarks

Paging enables you to display the contents of the GridView control in chunks. The number of items on a page is determined by the PageSize property. Normally, every row in the data source is read every time the GridView control moves to a different page. This can consume a lot of resources when the total number of items in the data source is very large. Custom paging allows you to read just the items you need for a single page from the data source.

To enable custom paging, set both the AllowPaging and AllowCustomPaging properties to true. In a handler for the PageIndexChanging event, set the PageIndex property to the new page index value, set the VirtualItemCount property to the total number of items in the data source, set the data source to return only the rows needed for the current page, and call the DataBind method. The VirtualItemCount property enables the control to determine the total number of pages; this value is normally determined automatically by reading all of the items.

Applies to