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

In-line substitution of Font in RadGrid HeaderText

2 Answers 30 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
frederic
Top achievements
Rank 1
frederic asked on 12 Sep 2014, 07:31 PM

I am trying to modify the contents of a RadGrid Column HeaderText item in C#.

I was unable to modify inline font characteristics from within the HeaderText property in the markup, so i tried in the code-behind thusly:

01.protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
02.        {
03.            if (e.Item is GridHeaderItem)
04.            {
05.                GridHeaderItem header = (GridHeaderItem)e.Item;
06. 
07.                foreach (string col in SysInvCols)
08.                {
09.                    Label lbl = new Label();
10.                    lbl.ID = "Label1";
11.                    header[col].Controls.Add(lbl);
12.                    lbl.Text = "E";
13.                    lbl.Font.Name = "Windings 3";
14.                }
15.            }

Unfortunately, the font is not modified as i would expect.  Is there another way to do what i'm trying to do?

Note: ASCII Character Code 69, the captial letter E in latin, and in wingdings 3 it is a pair of arrows (one pointing up and the other pointing down).

Please see attached image for clarity.



2 Answers, 1 is accepted

Sort by
0
frederic
Top achievements
Rank 1
answered on 12 Sep 2014, 07:38 PM
Unfortunately, I forgot to mention that the output just appends a capital E to the end of the headerText item in the grid column, and that the variable sysInvCols is a list of string values equal to the column header names.
0
Pavlina
Telerik team
answered on 17 Sep 2014, 05:03 PM
Hi,

Could you try setting different font to the header text inside grid PreRender event and let me know about the result.

Regards,
Pavlina
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.

 
Tags
General Discussions
Asked by
frederic
Top achievements
Rank 1
Answers by
frederic
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or