You don't need the PageIndexChanged
event, since you're not doing any funky stuff there.
As Ali Issa said, you should use the OnNeedDataSource
event, which is gonna be called when you fetch for next page.
So follow these steps:
Remove the following code:
protected void RadGrid1_PageIndexChanged(object source, Telerik.Web.UI.GridPageChangedEventArgs e)
{
this.GridView1.CurrentPageIndex = e.NewPageIndex;
GridView1.DataSource = tbl;
GridView1.DataBind();
}
in your aspx file:
OnPageIndexChanged="RadGrid1_PageIndexChanged"
And add the following code:
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
GridView1.DataSource = tbl;
}
in your aspx file:
OnNeedDataSource="RadGrid1_NeedDataSource"
One last thing: Don't forget your tbl
variable must be re-assigned on every server call (unless tbl
is a Session
variable). So, make sure tbl is at least defined in your Page_Load
but the best would be to replace tbl
to some Database call.