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

[Solved] Programatically setting ItemStyle.Font.Name for a column

1 Answer 168 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Louis
Top achievements
Rank 1
Louis asked on 15 Jun 2009, 06:11 PM

I am creating a variable number of RadGrids dynamically in code.  Everything is working fine and as expected, except this one thing.  I am trying to override the font for a particular column:

GridBoundColumn codeCov = new GridBoundColumn();  
                codeCov.ItemStyle.Font.ClearDefaults();  
                codeCov.ItemStyle.Font.Names = new String[] { "Webdings2" };  
                codeCov.HtmlEncode = true;                  
                codeCov.HeaderText = "Code Cov";  
                codeCov.DataField = "IsCodeCov";  
                codeCov.ItemStyle.HorizontalAlign = HorizontalAlign.Center;  
                codeCov.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;  
                rg.Columns.Add(codeCov);  
 

The cell is being serialized correctly (I think):

<
td align="center" style="font-family:Webdings 2;">
P</td>
(This should show up as a check-mark)

Yet the font is not displayed in the Webdings 2 font on the web page.  I wonder if the style for the row is overriding the cell?

The page contains a RadSkinManager and the skin is set to Web20.

Appreciate any help you can provide.

Regards,
Louis

1 Answer, 1 is accepted

Sort by
0
Louis
Top achievements
Rank 1
answered on 15 Jun 2009, 06:52 PM
Bah!  Dumb mistake - the proper font name is 'Wingdings 2', not 'Webdings 2'.  It works just fine.  Sorry for the noise.
Tags
Grid
Asked by
Louis
Top achievements
Rank 1
Answers by
Louis
Top achievements
Rank 1
Share this question
or