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

How to Change GridGroupHeaderItem Font Size?

3 Answers 114 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Radha
Top achievements
Rank 1
Radha asked on 05 Aug 2010, 11:49 AM
How to Change GridGroupHeaderItem Font  Size?

am using This Way ..
protected void rgMyFile_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridGroupHeaderItem)
        {
         
            (e.Item as GridGroupHeaderItem).Font.Size = FontUnit.Point(30);
            (e.Item as GridGroupHeaderItem).Font.Bold = true;
        }
    }
but its Not Working
protected void rgMyFile_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {

if (e.Item is GridGroupHeaderItem)
        {
            GridGroupHeaderItem item = e.Item as GridGroupHeaderItem;
             e.Item.Font.Size = FontUnit.Point(430);
            e.Item.Font.Bold = true;
            e.Item.CssClass = "bold";
        }
}

using This way also not Working.
give me any solution

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Aug 2010, 12:37 PM
Hello Radha,

You can easily change the font size of GridGruopHeaderItem by adding following CSS in your page.

CSS:
<style type="text/css">
      .rgGroupHeader
      {
          font-size:20px !important;
      }
  </style>

Thanks,
Princy.
0
Radha
Top achievements
Rank 1
answered on 05 Aug 2010, 01:21 PM
This is not Working
0
Princy
Top achievements
Rank 2
answered on 05 Aug 2010, 02:35 PM
Hello Radha,

I am not sure about why the above CSS not working for you. An alternate method for setting style for GridHeaderItem is shown below. Could you try the following code in ItemDataBound event and see whether it helps?

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
       if (e.Item is GridGroupHeaderItem)
        {
            GridGroupHeaderItem groupHeader = (GridGroupHeaderItem)e.Item;
            groupHeader.Style.Add("font-size", "20px");
        }
    }

Also, please check whether any CSS is overridding the style we set.


Thanks,
Princy.
Tags
Grid
Asked by
Radha
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Radha
Top achievements
Rank 1
Share this question
or