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

How to set styles to RAD Grid Group by fields in PDF

5 Answers 112 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Radha
Top achievements
Rank 1
Radha asked on 03 Dec 2012, 01:30 PM
Please help me how to set styles like text-alignment,font-family,font-size etc.. for group by fields while exporting to PDF from RAD GRID.

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Dec 2012, 05:46 AM
Hi,

Try the following code to achieve your scenario.
C#:
bool isexport = false;
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
 isexport = true;
 if (e.Item is GridGroupHeaderItem && isexport)
 {
   foreach (TableCell cell in e.Item.Cells)
   {
     cell.Style.Add("color", "Red");
     cell.Style.Add("font-size","large");
   }
 }
}

Thanks,
Princy.
0
Radha
Top achievements
Rank 1
answered on 04 Dec 2012, 10:13 AM
It worked well.

Thank you princy for the reply.

0
Radha
Top achievements
Rank 1
answered on 04 Dec 2012, 03:10 PM
Every thing worked properly except setting the font family to verdana ,i am trying to set font family to verdana but while rendering it is taking as times new roman.please help to set the font family to verdana.
0
Princy
Top achievements
Rank 2
answered on 05 Dec 2012, 05:28 AM
Hi,

Unfortunately I cannot replicate the issue at my end. Here is the sample code that I tried which worked as expected.
C#:
bool isexport = false;
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
 isexport = true;
 if (e.Item is GridGroupHeaderItem && isexport)
 {
   foreach (TableCell cell in e.Item.Cells)
   {
     cell.Style.Add("font-family", "Verdana");
   }
 }
}

Thanks,
Princy.
0
Radha
Top achievements
Rank 1
answered on 06 Dec 2012, 09:57 AM
Thanks prince.
  I changed from font-family to font-names and it worked well.
Tags
General Discussions
Asked by
Radha
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Radha
Top achievements
Rank 1
Share this question
or