Articles in this section
Category / Section

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

1 min read

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

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied