PagedDataSource 类

定义

封装数据绑定控件(如 DataGridGridViewDetailsViewFormView)的与分页相关的属性,以允许该控件执行分页操作。Encapsulates the paging-related properties of a data-bound control (such as DataGrid, GridView, DetailsView, and FormView) that allow it to perform paging. 此类不能被继承。This class cannot be inherited.

public ref class PagedDataSource sealed : System::Collections::ICollection, System::ComponentModel::ITypedList
public sealed class PagedDataSource : System.Collections.ICollection, System.ComponentModel.ITypedList
type PagedDataSource = class
    interface ICollection
    interface IEnumerable
    interface ITypedList
Public NotInheritable Class PagedDataSource
Implements ICollection, ITypedList
继承
PagedDataSource
实现

注解

GridView DataGrid FormView DetailsView类封装属性, 这些属性允许数据源控件 (如、、和) 执行分页。 PagedDataSourceThe PagedDataSource class encapsulates the properties that allow data-source controls, such as the DataGrid, GridView, DetailsView, and FormView, to perform paging. 当向自定义数据绑定控件提供分页支持时, 控件开发人员将使用此类。This class is used by control developers when providing paging support to a custom data-bound control.

此类使用最佳的可用方法对属于当前页的数据进行枚举。This class uses the best available method to enumerate over the data belonging to the current page. 如果基础数据源支持索引访问 (如System.ArraySystem.Collections.IList), 则此类将使用它。If the underlying data source supports indexed access (such as System.Array and System.Collections.IList), this class uses it. 否则, 它将使用由GetEnumerator方法创建的枚举器。Otherwise, it uses the enumerator created by the GetEnumerator method.

有关实例PagedDataSource的初始属性值的列表, PagedDataSource请参见构造函数。For a list of initial property values for an instance of PagedDataSource, see the PagedDataSource constructor.

构造函数

PagedDataSource()

初始化 PagedDataSource 类的新实例。Initializes a new instance of the PagedDataSource class.

属性

AllowCustomPaging

获取或设置一个值,指示是否在数据绑定控件中启用自定义分页。Gets or sets a value indicating whether custom paging is enabled in a data-bound control.

AllowPaging

获取或设置一个值,指示是否在数据绑定控件中启用分页。Gets or sets a value indicating whether paging is enabled in a data-bound control.

AllowServerPaging

获取或设置一个值,指示是否启用服务器端分页。Gets or sets a value indicating whether server-side paging is enabled.

Count

获取要从数据源使用的项数。Gets the number of items to be used from the data source.

CurrentPageIndex

获取或设置当前页的索引。Gets or sets the index of the current page.

DataSource

获取或设置数据源。Gets or sets the data source.

DataSourceCount

获取数据源中的项数。Gets the number of items in the data source.

FirstIndexInPage

获取页面中显示的首条记录的索引。Gets the index of the first record displayed on the page.

IsCustomPagingEnabled

获取一个值,该值指示是否启用自定义分页。Gets a value indicating whether custom paging is enabled.

IsFirstPage

获取一个值,该值指示当前页是否是首页。Gets a value indicating whether the current page is the first page.

IsLastPage

获取一个值,该值指示当前页是否是最后一页。Gets a value indicating whether the current page is the last page.

IsPagingEnabled

获取一个值,该值指示是否启用分页。Gets a value indicating whether paging is enabled.

IsReadOnly

获取一个值,该值指示数据源是否是只读的。Gets a value indicating whether the data source is read-only.

IsServerPagingEnabled

获取一个值,指示是否启用服务器端分页支持。Gets a value indicating whether server-side paging support is enabled.

IsSynchronized

获取一个值,该值指示是否同步对数据源的访问(线程安全)。Gets a value indicating whether access to the data source is synchronized (thread-safe).

PageCount

获取显示数据源中的所有项所需要的总页数。Gets the total number of pages necessary to display all items in the data source.

PageSize

获取或设置要在单页上显示的项数。Gets or sets the number of items to display on a single page.

SyncRoot

获取可用于同步集合访问的对象。Gets the object that can be used to synchronize access to the collection.

VirtualCount

获取或设置在使用自定义分页时数据源中的实际项数。Gets or sets the virtual number of items in the data source when custom paging is used.

方法

CopyTo(Array, Int32)

Array 中的指定索引位置开始,将数据源中的所有项复制到指定的 ArrayCopies all the items from the data source to the specified Array, starting at the specified index in the Array.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetEnumerator()

返回一个实现了 IEnumerator 的对象,该对象包含数据源中的所有项。Returns a IEnumerator implemented object that contains all items in the data source.

GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetItemProperties(PropertyDescriptor[])

返回 PropertyDescriptorCollection,其表示每一项上用于绑定数据的属性。Returns the PropertyDescriptorCollection that represents the properties on each item used to bind data.

GetListName(PropertyDescriptor[])

返回列表名称。Returns the name of the list. 此方法不适用于此类。This method does not apply to this class.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

扩展方法

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于

另请参阅