We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid Header Font

Hi there, I am trying to set the font for the header cell. However, when I try to set it the first time, it is ok. Setting it the second time doesn''t seem to have any effect on the heder cells.

3 Replies

AD Administrator Syncfusion Team December 10, 2004 07:30 PM UTC

Hi Patrick, are you referring to the design-time or changing headers with code? If code, can you post code snippets? Which version of Essential Grid and which .NET Framework version are you using? Thank You, Stefan


AD Administrator Syncfusion Team November 9, 2008 08:57 AM UTC

hi;i have the same problem.i used a DataBoundGrid .i want to change the header font to "tahoma". how can i do this?



NA Nisha Arockiya A Syncfusion Team November 10, 2008 07:34 AM UTC

Hi Shayesteh,

You can achieve this by handling PrepareViewStyleInfo event. In the event handler check for the e.RowIndex and e.ColIndex and set the font.
Here is the code snippet.

void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if (e.RowIndex == 0 && e.ColIndex > 0)
e.Style.Font = new GridFontInfo(new Font("Tahoma", 10, FontStyle.Italic));
}


Please let me know if this serve your neeeds.

Regards,
Nisha


Loader.
Live Chat Icon For mobile
Up arrow icon