DetailsView.PageIndex 属性

定义

获取或设置所显示的记录的索引。Gets or sets the index of the displayed record.

public:
 virtual property int PageIndex { int get(); void set(int value); };
[System.ComponentModel.Bindable(true)]
public virtual int PageIndex { get; set; }
member this.PageIndex : int with get, set
Public Overridable Property PageIndex As Integer

属性值

正从基础数据源显示在 DetailsView 控件中的数据项的从零开始的索引。The zero-based index of the data item being displayed in a DetailsView control from the underlying data source.

属性

异常

选定值小于 -1The selected value is less than -1.

注解

启用分页功能后 ( AllowPaging属性设置为true), 请使用PageIndex属性来确定当前显示的记录的索引。When the paging feature is enabled (when the AllowPaging property is set to true), use the PageIndex property to determine the index of the currently displayed record. 还可以使用此属性以编程方式更改显示的记录。You can also use this property to programmatically change the displayed record.

备注

启用分页功能后, 还可以使用此属性来确定所显示记录的页码;但请注意, 此属性是从零开始的。When the paging feature is enabled, you can also use this property to determine the page number of the record displayed; however, be aware that this property is zero-based.

若要确定数据源中的总项数, 请使用PageCount属性。To determine the total number of items in the data source, use the PageCount property.

适用于

另请参阅