In the RadGrid1_ItemDataBound I have the following piece of code for displaying the number of records returned in the grids footer.
GridBoundColumn recordCount = RadGrid1.MasterTableView.GetColumn("FieldOne") as GridBoundColumn; |
recordCount.Aggregate = GridAggregateFunction.Count; |
recordCount.FooterText = "<strong style='Font-size:10pt;color:red;'>Rows Returned: "; |
However, when I click to export the results to a PDF and only a PDF the error below shows up. The Excel and Word work just fine. The style tag I added is causing this issue.... :(
Invalid XHTML. RadGrid has to render correct XHTML in order to export to PDF.
Parse error:
The 'strong' start tag on line 697 does not match the end tag of 'td'. Line 697, position 84.
at line:
<td> </td><td><strong style='Font-size:10pt;color:red;'>Rows Returned: 10</td><td> </td><td>&........
My question is how can I apply a style to the number of rows returned in my footer so the PDF export does not throw an error? Also, is there a better place to show the number or rows returned?
Thank You!
7 Answers, 1 is accepted

Go through the following KB article which explains how to export styles in PDF.
Exporting styles in PDF
Shinu

Where can i find this article? thank you
I attached a sample project to this post. It illustrates how to apply custom styles to the PDF file.
I hope this helps.
Regards,
Daniel
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

this is helpfull.

You can hide the column explicitly by setting its Visible property to false prior to the export operation (call to the ExportToPDF() method of the master table). Review the information/code snippets from the help topic pointed below for further details:
http://www.telerik.com/help/aspnet-ajax/grdexporttipstricks.html (paragraph 'Exporting GridButtonColumn/GridTemplateColumn/GridHyperLinkColumn data')
Best regards,
Sebastian
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

if I am missing something on the GridTemplateColumn and hiding it another way let me know, ok!
<telerik:GridTemplateColumn HeaderText="Actions".... |
Grid1.MasterTableView.Columns.FindByUniqueName("Actions").Visible = false; |
I am also getting the following error on this code during my Intem_DataBound
Object reference not set to an instance of an object. |
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. |
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. |
Source Error: |
Line 112: { |
Line 113: case ((int)Enumeration.RefreshStatus.Failed): |
Line 114: message.Text = Convert.ToString(dataItem["ERROR_MESSAGE"].Text); |
Line 115: imageMessage.Text = Convert.ToString(dataItem["ERROR_MESSAGE"].Text); |
Line 116: imageResults.Visible = true; |