I am working inside of a DotNetNuke (DNN) module which has partial page update enabled. I have a RadGrid "Prometheus" inside of this module with export capability. The grid is bound dynamically to a dataset in the RadGrid1_NeedDataSource event.
I implemented RadGrid "Prometheus" Export with AJAX using the sample given.
http://www.telerik.com/community/code-library/submission/b311D-ttcbe.aspx
The particular example I used from this posting was: 078227_RadGridExportFromWithinUpdatePanel_Web_UI.zip
This is because when partial page update is enabled for a DNN module, it places the whole module within an update panel.
I used the following settings:
RadGrid1.ExportSettings.IgnorePaging = true;
RadGrid1.ExportSettings.ExportOnlyData = true;
And it works fine.
Then I used another sample from the Telerik forums to change the header text of the RadGrid columns:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
if (Session["headerTexts"] != null)
{
Hashtable headerTexts = (Hashtable)Session["headerTexts"];
foreach (string key in headerTexts.Keys)
{
GridColumn column = RadGrid1.MasterTableView.GetColumn(key);
column.HeaderText = headerTexts[key].ToString();
}
RadGrid1.Rebind();
}
}
And this works fine too!
However, now when I export after I added the header text change in the pre-render event I get the following error:
Script controls may not be registered after PreRender.
Also notice that it says "after" pre-render. There are some posts on the web related to "before" pre-render.
If I take out the header text change in the pre-render event, it works fine.
I would appreciate if someone could tell me the solution to the above problem.
Thanks,
Tal