Please assist:
Overview:
I retrieve data from a database. This data is grouped into sets and each set is displayed in its own RadGrid that I display dynamically. Because the amount of data groups that are returned are not always the same, the radgrids needs to be dynamically created and displayed.
Problem:
The Radgrids display correctly, however, paging does not work. When the page loads for the first time the all the radgrids displays correctly, with the correct amounts of rows, page numbers etc. However, when I click on any of the paging links it clears the page and does NOT fire the PageChanged or PageChanging event.
My Code:
Telerik.Web.UI.RadGrid grdDynamicIAData = new Telerik.Web.UI.RadGrid();
grdDynamicIAData.ID = "grv" + ia.Short_Name;
grdDynamicIAData.EnableViewState = true;
grdDynamicIAData.PageSize = 5;
grdDynamicIAData.AutoGenerateColumns = true;
grdDynamicIAData.AllowSorting = true;
grdDynamicIAData.AllowPaging = true;
grdDynamicIAData.PageIndexChanged += new GridPageChangedEventHandler(grdDynamicIAData_PageIndexChanged);
grdDynamicIAData.DataSource = dtDynamicIAData;
grdDynamicIAData.DataMember = dtDynamicIAData.TableName;
grdDynamicIAData.DataBind();
void grdDynamicIAData_PageIndexChanged(object sender, Telerik.Web.UI.GridPageChangedEventArgs e)
{
Telerik.Web.UI.RadGrid grdDynamicIAData = (Telerik.Web.UI.RadGrid)sender;
GeneratePopulateDataGrids("paging");
grdDynamicIAData.CurrentPageIndex = e.NewPageIndex;
grdDynamicIAData.DataBind();
}
Thank you.
Overview:
I retrieve data from a database. This data is grouped into sets and each set is displayed in its own RadGrid that I display dynamically. Because the amount of data groups that are returned are not always the same, the radgrids needs to be dynamically created and displayed.
Problem:
The Radgrids display correctly, however, paging does not work. When the page loads for the first time the all the radgrids displays correctly, with the correct amounts of rows, page numbers etc. However, when I click on any of the paging links it clears the page and does NOT fire the PageChanged or PageChanging event.
My Code:
Telerik.Web.UI.RadGrid grdDynamicIAData = new Telerik.Web.UI.RadGrid();
grdDynamicIAData.ID = "grv" + ia.Short_Name;
grdDynamicIAData.EnableViewState = true;
grdDynamicIAData.PageSize = 5;
grdDynamicIAData.AutoGenerateColumns = true;
grdDynamicIAData.AllowSorting = true;
grdDynamicIAData.AllowPaging = true;
grdDynamicIAData.PageIndexChanged += new GridPageChangedEventHandler(grdDynamicIAData_PageIndexChanged);
grdDynamicIAData.DataSource = dtDynamicIAData;
grdDynamicIAData.DataMember = dtDynamicIAData.TableName;
grdDynamicIAData.DataBind();
void grdDynamicIAData_PageIndexChanged(object sender, Telerik.Web.UI.GridPageChangedEventArgs e)
{
Telerik.Web.UI.RadGrid grdDynamicIAData = (Telerik.Web.UI.RadGrid)sender;
GeneratePopulateDataGrids("paging");
grdDynamicIAData.CurrentPageIndex = e.NewPageIndex;
grdDynamicIAData.DataBind();
}
Thank you.