New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
PageIndexChanged Event
Updated over 6 months ago
Fired when one of the page selection elements is clicked.
Event Parameters
- 
(object)sender- The control that fires the event
 
- 
(GridPageChangedEventArgs)e- 
Event arguments that - 
(boolean)e.CanceledIf set to True the event will be canceled 
- 
(object)e.CommandArgumentGets the argument for the command. 
- 
(string)e.CommandNameGets the name of the command. 
- 
(object)e.CommandSourceGets the source of the commmand 
- 
(GridItem)e.ItemGets the item containing the command 
- 
(int)e.NewPageIndexGets the new page index the Grid will go on. 
 
- 
 
- 
Attaching the event
In the Markup
ASP.NET
<telerik:RadGrid ID="RadGrid1" runat="server" OnPageIndexChanged="RadGrid1_PageIndexChanged">
</telerik:RadGrid>In the Code behind
C#
protected void Page_Init(object sender, EventArgs e)
{
    RadGrid1.PageIndexChanged += RadGrid1_PageIndexChanged;
}The event handler
C#
protected void RadGrid1_PageIndexChanged(object sender, GridPageChangedEventArgs e)
{
    bool canceled = e.Canceled;
    object commandArguments = e.CommandArgument;
    string commandName = e.CommandName;
    object source = e.CommandSource;
    GridItem item = e.Item;
    int newPageIndex = e.NewPageIndex;
}