GridViewPageEventArgs Class

Provides data for the PageIndexChanging event.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public ref class GridViewPageEventArgs : public CancelEventArgs
public class GridViewPageEventArgs extends CancelEventArgs
public class GridViewPageEventArgs extends CancelEventArgs
Not applicable.

The GridView control raises the PageIndexChanging event when a pager button (a button with its CommandName property set to "Page") within the control is clicked, but before the GridView control handles the paging operation. This allows you to provide an event-handling method that performs a custom routine, such as canceling the paging operation, whenever this event occurs.

NoteNote:

Pager buttons are usually located in the pager row of a GridView control.

A GridViewPageEventArgs object is passed to the event-handling method, which allows you to determine the index of the page selected by the user and to indicate that the paging operation should be canceled. To cancel the paging operation, set the CancelEventArgs.Cancel property of the GridViewPageEventArgs object to true.

For more information about handling events, see Consuming Events.

For a list of initial property values for an instance of GridViewPageEventArgs, see the GridViewPageEventArgs constructor.

The following example demonstrates how to use the GridViewPageEventArgs object passed to the event-handling method to determine the index of the page selected by the user and to cancel the paging operation.

No code example is currently available or this language may not be supported.

  • AspNetHostingPermission  For operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
  • AspNetHostingPermission  For operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.

System.Object
   System.EventArgs
     System.ComponentModel.CancelEventArgs
      System.Web.UI.WebControls.GridViewPageEventArgs

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: