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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I change the appearance of a single header cell?

Platform: WinForms |
Control: GridDataBoundGrid(Classic) |
Published Date: April 30, 2011 |
Last Revised Date: June 20, 2021

The GridDataBoundGrid supports to change the appearance of a single cell by using the PrepareViewStyleInfo event.

C#

//change the appearance of a second header cell
if (e.ColIndex == 2 && e.RowIndex == 0)
{
e.Style.Font.Italic = true;
e.Style.Font.Bold = true;
e.Style.Font.Orientation = 5;
e.Style.TextColor = Color.Red;
}

VB

Private Sub gridDataBoundGrid1_PrepareViewStyleInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs)
'change the appearance of a second header cell
If e.ColIndex = 2 AndAlso e.RowIndex = 0 Then
e.Style.Font.Italic = True
e.Style.Font.Bold = True
e.Style.Font.Orientation = 5
e.Style.TextColor = Color.Red
End If
End Sub

After applying the properties, the appearance of the header cell is displayed as follows.

After changing the appearance for header cell

Figure 1: Appearance of the header text changed

Sample Links

CS: Changing the appearance for header cell

VB: Changing the appearance for header cell

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile