DataGridPageChangedEventArgs Constructor
Initializes a new instance of the DataGridPageChangedEventArgs class.
[Visual Basic] Public Sub New( _ ByVal commandSource As Object, _ ByVal newPageIndex As Integer _ ) [C#] public DataGridPageChangedEventArgs( object commandSource, int newPageIndex ); [C++] public: DataGridPageChangedEventArgs( Object* commandSource, int newPageIndex ); [JScript] public function DataGridPageChangedEventArgs( commandSource : Object, newPageIndex : int );
Parameters
- commandSource
- The source of the command.
- newPageIndex
- The index of the page selected by the user from the page selection element of the DataGrid control.
Remarks
Use this constructor to create and initialize a new instance of the DataGridPageChangedEventArgs class.
When an instance of DataGridCommandEventArgs is created by a call to this constructor, the following properties are initialized to the specified values.
| Properties | Initial Value |
|---|---|
| CommandSource | The commandSource parameter. |
| NewPageIndex | The newPageIndex parameter. |
Example
[Visual Basic, C#, C++] The following example demonstrates how to create and initialize a new instance of the DataGridPageChangedEventArgs class.
[Visual Basic] Sub Grid_Change(sender As Object, e As DataGridPageChangedEventArgs) Dim page_change_args As New DataGridPageChangedEventArgs(e.CommandSource, e.NewPageIndex) End Sub 'Grid_Change [C#] void Grid_Change(Object sender, DataGridPageChangedEventArgs e) { DataGridPageChangedEventArgs page_change_args = new DataGridPageChangedEventArgs(e.CommandSource, e.NewPageIndex); } [C++] void Grid_Change(Object* /*sender*/, DataGridPageChangedEventArgs* e) { DataGridPageChangedEventArgs* page_change_args = new DataGridPageChangedEventArgs(e->CommandSource, e->NewPageIndex); }
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family
See Also
DataGridPageChangedEventArgs Class | DataGridPageChangedEventArgs Members | System.Web.UI.WebControls Namespace