New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
PageSizeChanged Event
Fired when the page size is changed through the advanced pager or manually in code
Event Parameters
-
(object)
sender- The control that fires the event
-
(GridPageSizeChangedEventArgs)
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.NewPageSizeGets the new selected page size that will be applied.
-
-
Attaching the event
In the Markup
ASP.NET
<telerik:RadGrid ID="RadGrid1" runat="server" OnPageSizeChanged="RadGrid1_PageSizeChanged">
</telerik:RadGrid>
In the Code behind
C#
protected void Page_Init(object sender, EventArgs e)
{
RadGrid1.PageSizeChanged += RadGrid1_PageSizeChanged;
}
The event handler
C#
protected void RadGrid1_PageSizeChanged(object sender, GridPageSizeChangedEventArgs e)
{
bool canceled = e.Canceled;
object commandArgs = e.CommandArgument;
string commandName = e.CommandName;
object commandSource = e.CommandSource;
GridItem item = e.Item;
int newPageSize = e.NewPageSize;
}