asp.net.ph

DetailsView.PageIndex Property

System.Web.UI.WebControls Namespace   DetailsView Class


.NET Framework version 2.0

Sets or retrieves the index of the currently displayed page.

Syntax


Script DetailsView.PageIndex [ = intIndex ]

This property can only be used programmatically; it cannot be set when declaring the control.

Property Value


intIndex The index of the page currently displayed.

The property is read/write with a default value of 0 ( zero ).

Exceptions


Exception Type Condition
ArgumentOutOfRangeException The given page index is a negative value.

Remarks

Use this property to determine the currently displayed page in the DetailsView control when paging is enabled. This property is also used to programmatically control which page is displayed.

To display a specific page, set this property to the page index you want to display and then rebind the data to the DetailsView control.

NOTE: The PageIndex property is zero based.

To determine the total number of items in the data source, use the PageCount property.

Example

The following example demonstrates how to use the PageIndex property to determine the currently displayed page in a DetailsView control .

<p>Viewing Page <%= empsView.PageIndex + 1 %> of <%= empsView.PageCount %></p>

 Show me 

See Also

DetailsView Members   AllowPaging   PageCount Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph