PagedDataSource PagedDataSource PagedDataSource PagedDataSource Class

定义

封装数据绑定控件(如 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
继承
PagedDataSourcePagedDataSourcePagedDataSourcePagedDataSource
实现

注解

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() PagedDataSource() PagedDataSource()

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

属性

AllowCustomPaging AllowCustomPaging AllowCustomPaging AllowCustomPaging

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

AllowPaging AllowPaging AllowPaging AllowPaging

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

AllowServerPaging AllowServerPaging AllowServerPaging AllowServerPaging

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

Count Count Count Count

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

CurrentPageIndex CurrentPageIndex CurrentPageIndex CurrentPageIndex

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

DataSource DataSource DataSource DataSource

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

DataSourceCount DataSourceCount DataSourceCount DataSourceCount

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

FirstIndexInPage FirstIndexInPage FirstIndexInPage FirstIndexInPage

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

IsCustomPagingEnabled IsCustomPagingEnabled IsCustomPagingEnabled IsCustomPagingEnabled

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

IsFirstPage IsFirstPage IsFirstPage IsFirstPage

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

IsLastPage IsLastPage IsLastPage IsLastPage

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

IsPagingEnabled IsPagingEnabled IsPagingEnabled IsPagingEnabled

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

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

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

IsServerPagingEnabled IsServerPagingEnabled IsServerPagingEnabled IsServerPagingEnabled

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

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

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

PageCount PageCount PageCount PageCount

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

PageSize PageSize PageSize PageSize

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

SyncRoot SyncRoot SyncRoot SyncRoot

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

VirtualCount VirtualCount VirtualCount VirtualCount

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

方法

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) 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) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

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

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetItemProperties(PropertyDescriptor[]) GetItemProperties(PropertyDescriptor[]) GetItemProperties(PropertyDescriptor[]) GetItemProperties(PropertyDescriptor[])

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

GetListName(PropertyDescriptor[]) GetListName(PropertyDescriptor[]) GetListName(PropertyDescriptor[]) GetListName(PropertyDescriptor[])

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

GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

扩展方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

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

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于

另请参阅