This is a migrated thread and some comments may be shown as answers.

Group header/footer style missing with PDF export

3 Answers 262 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 1
Phil asked on 27 May 2009, 06:56 PM
When I export from the RadGrid while the grid is grouping the data and export, the style for the group header and group footer are not showing on the PDF.  The source HTML looks exactly like the overall footer for the group footer with the exception of the overall footer being in the <tfoot> tags.  In the group footer and header there is a background color but it is not showing in the PDF and also some of the cells in the footer have right aligned text but it's all left aligned.  Also, the font size isnt the same as the rest of the grid in the group footer. 

We are using a custom skin file based on the Outlook2007 skin.

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 28 May 2009, 07:37 AM
Hello Phil,

Please examine the attached demo which illustrates how to apply styles to the exported file.

Example:
if (e.Item is GridGroupHeaderItem
    e.Item.Style["background-color"] = "blue"

More information is available in our documentation:
Exporting tips and tricks

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Phil
Top achievements
Rank 1
answered on 28 May 2009, 04:09 PM
ok, that works fine except I have a few columns with different alignments.  Is there a way of knowing the alignment that was set in the markup of the RadGrid?  The code needs to be generic cause I'm using a wrapper for the RadGrid that will set all the default properties and handle the export so setting a specific cell to an alignment is not possible since the wrapper class will have no knowledge of how the RadGrid is laid out.  So if I have ItemStyle-HorizontalAlign="Right" in the markup, is there a way to look at the data item cell and see this set on the ItemCreated event of the RadGrid?
0
Daniel
Telerik team
answered on 28 May 2009, 04:29 PM
Hello Phil,

You can get the desired information from the column's style:
foreach (GridColumn col in RadGrid1.MasterTableView.Columns) 
{  
    if(col.ItemStyle.HorizontalAlign == HorizontalAlign.Center) 
        //... 
    if(col.HeaderStyle.VerticalAlign == VerticalAlign.Bottom) 
        //... 

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Phil
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Phil
Top achievements
Rank 1
Share this question
or