GridView.AllowCustomPaging Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
الملاحظات
https://aka.ms/ContentUserFeedback.
قريبًا: خلال عام 2024، سنتخلص تدريجيًا من GitHub Issues بوصفها آلية إرسال ملاحظات للمحتوى ونستبدلها بنظام ملاحظات جديد. لمزيد من المعلومات، راجعإرسال الملاحظات وعرضها المتعلقة بـ