I have an ASP.NET application with several RadGrids on it displaying data, as well as some other text and images. All of the content is contained within an ASP.NET Ajax tabcontainer. The end user wants the ability to export all of the data to a PDF file, so I thought it might be a good idea to put a RadEditor on another tab, and have all of the data from the application added to the RadEditor content area, and then when the end user is ready they can make any needed changes in the RadEditor, and then use the ExportToPDF function to get the PDF.
However, I have been unable to get the data from the RadGrids into the RadEditor, can anyone give me some insight as to how I can accomplish this? I tried this:
public string RenderControl(Control ctrl)
{
StringBuilder sb = new StringBuilder();
StringWriter tw = new StringWriter(sb);
HtmlTextWriter hw = new HtmlTextWriter(tw);
ctrl.RenderControl(hw);
return sb.ToString();
}
protected void Button1_Click1(object sender, EventArgs e)
{
RadEditor1.Content += RenderControl(RadGrid1);
RadEditor1.ExportToPdf();
}
But I got some kind of script error:
Script control 'RadGrid1' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
Parameter name: scriptControl
Any and all input is greatly appreciated.
John.