PageIndexChanged occurs when one of the pager buttons is clicked, but after the GridView control handles the paging operation
The PageIndexChanged event is raised when one of the pager buttons is clicked, but after the GridView control handles the paging operation. This enables you to provide an event-handling method that performs a custom routine, such as a custom paging operation, whenever this event occurs.
To determine the index of the page selected by the user, use the PageIndex property of the GridView control.
When the paging feature is enabled (by setting the AllowPaging property to true), use the PageIndex property to determine the index of the currently displayed page. You can also use this property to programmatically change the displayed page.