DataGridPageChangedEventArgs(Object, Int32) 构造函数

定义

初始化 DataGridPageChangedEventArgs 类的新实例。

public:
 DataGridPageChangedEventArgs(System::Object ^ commandSource, int newPageIndex);
public DataGridPageChangedEventArgs (object commandSource, int newPageIndex);
new System.Web.UI.WebControls.DataGridPageChangedEventArgs : obj * int -> System.Web.UI.WebControls.DataGridPageChangedEventArgs
Public Sub New (commandSource As Object, newPageIndex As Integer)

参数

commandSource
Object

命令源。

newPageIndex
Int32

用户从 DataGrid 控件的页选择元素选定的页的索引。

示例

下面的代码示例演示如何创建和初始化类的新实例 DataGridPageChangedEventArgs

void Grid_Change(Object sender, DataGridPageChangedEventArgs e)
{
   DataGridPageChangedEventArgs page_change_args = new DataGridPageChangedEventArgs(e.CommandSource, e.NewPageIndex);
}
Sub Grid_Change(sender As Object, e As DataGridPageChangedEventArgs)
    Dim page_change_args As New DataGridPageChangedEventArgs(e.CommandSource, e.NewPageIndex)
End Sub

注解

使用此构造函数创建和初始化类的新实例 DataGridPageChangedEventArgs

通过调用此构造函数创建实例 DataGridCommandEventArgs 时,以下属性将初始化为指定的值。

属性 初始值
CommandSource commandSource 参数。
NewPageIndex newPageIndex 参数。

适用于