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

RadGrid Export to Pdf Cell Formating not working

4 Answers 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rahul
Top achievements
Rank 1
rahul asked on 25 Dec 2014, 06:31 AM
Hi,
           I want a grid export to PDF but after exporting formatting not showing on PDF.

I  am using this style for formatting but it not works

   item["Average"].Style["font-weight"] = "Bold";   item["Average"].Style["text-decoration"] = "underline";

OR
   item["Average"].Font.Bold=true;       item["Average"].Font.Underline=true;

Please Check the attachment .

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 26 Dec 2014, 04:46 PM
Hello Rahul,

I would recommend that you use the HTML tags for underline (u) and bold (b). Your approach with applying inline font-weight style will work properly if you change "Bold" to "bold".

Regards,
Daniel
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
rahul
Top achievements
Rank 1
answered on 30 Dec 2014, 06:56 AM
Hi Daniel,

Thanks for reply, Actually my grid or its column is a dynamically created so i want to apply this style server side but it effects on Grid Data not  work for after grid export to PDF. On PDF style not apply.

Please provide working simple source code with demo.
0
Daniel
Telerik team
answered on 31 Dec 2014, 03:31 PM
Hello Rahul,

Please try the following:
var cell = item["Average"];
cell.Text = String.Format("<u>{0}</u>", cell.Text);

If you have a case where the whole column must have the same style then try this:
<telerik:GridBoundColumn ... DataFormatString="<b>{0}</b>"></telerik:GridBoundColumn>

The above approach can also be implemented programmatically.

Regards,
Daniel
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
rahul
Top achievements
Rank 1
answered on 01 Jan 2015, 12:01 PM
Thanks Daniel, its work fine. :)
Tags
Grid
Asked by
rahul
Top achievements
Rank 1
Answers by
Daniel
Telerik team
rahul
Top achievements
Rank 1
Share this question
or