How to Change GridGroupHeaderItem Font Size?

4 posts, 0 answers
  1. Radha
    Radha avatar
    8 posts
    Member since:
    Jul 2008

    Posted 05 Aug 2010 Link to this post

    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

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Aug 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Radha
    Radha avatar
    8 posts
    Member since:
    Jul 2008

    Posted 05 Aug 2010 Link to this post

    This is not Working
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Aug 2010 Link to this post

    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.
Back to Top