System.Web.UI.WebControls.ObjectDataSource.EnablePaging Property

Gets or sets a value that indicates whether the data source control supports paging through the set of data that it retrieves.

Syntax

[System.ComponentModel.DefaultValue(false)]
public bool EnablePaging { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Paging by the System.Web.UI.WebControls.ObjectDataSource control is handled by setting the ObjectDataSource.EnablePaging, ObjectDataSource.StartRowIndexParameterName, ObjectDataSource.MaximumRowsParameterName, and ObjectDataSource.SelectCountMethod properties of the System.Web.UI.WebControls.ObjectDataSource and defining a select method in the business object with the proper parameters. When the ObjectDataSource.EnablePaging property is set to true, the ObjectDataSource.SelectParameters collection includes two additional parameters for the first row that is requested and the number of rows that are requested. These two parameters are named as defined by the ObjectDataSource.StartRowIndexParameterName and ObjectDataSource.MaximumRowsParameterName properties. The Select method should return the requested number of rows, starting at the specified index. Because the data might not divide evenly by the page size, the last page might contain fewer rows. Thus, the number of rows that are requested is actually the maximum number of rows that are returned.

When paging is enabled on the associated data-bound control, the data-bound control calls the Select method with the start index and number of rows that are required. Additionally, if the ObjectDataSource.SelectCountMethod property is set, the data-bound control calls the method before rendering the pager controls. For example, if a System.Web.UI.WebControls.GridView control has paging enabled with a page size of 5, and the method that is specified by the ObjectDataSource.SelectCountMethod property returns 20, only 4 pages are displayed in the pager.

The ObjectDataSource.EnablePaging property delegates to the ObjectDataSourceView.EnablePaging property of the System.Web.UI.WebControls.ObjectDataSourceView object.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0