asp.net.ph

DataGrid.PageIndexChanged Event

System.Web.UI.WebControls Namespace   DataGrid Class


Occurs when one of the page selection elements is clicked.

[ VB ]
Public Event PageIndexChanged As DataGridPageChangedEventHandler

[ C# ]
public event DataGridPageChangedEventHandler PageIndexChanged;

[ C++ ]
public: __event DataGridPageChangedEventHandler* PageIndexChanged;

In [ JScript ], you can handle the events defined by a class, but you cannot define your own.

Event Data

The method assigned to handle the event is passed an argument of type DataGridPageChangedEventArgs object containing data related to this event. The following DataGridPageChangedEventArgs properties provide information specific to this event.

Property Description
CommandSource Gets the source of the command.
NewPageIndex Gets the index of the page selected by the user in the page selection element of the DataGrid control.

Remarks

The PageIndexChanged event is raised whenever any of the link buttons in the page selection element of a DataGrid control is clicked.

For more information about handling events, see Web Forms Events Model.

Example

The following examples demonstrate how to specify and code a handler for the PageIndexChanged event.

DataGrid AllowPaging Property
Run Sample | View Source
Custom Paging with AutoIncrement Data Model
Run Sample | View Source
Custom Paging Using Primary Key Values
Run Sample | View Source
See Also

DataGrid Members   AllowPaging   AllowCustomPaging   DataGridPageChangedEventArgs   DataGridPageChangedEventHandler 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