Articles in this section
Category / Section

How to change a table wide default font style to bold in WinForms GridControl?

1 min read

Font settings

When an attribute of a cell’s style is not explicitly set for that cell, the unset attribute is inherited from the standard style, the column style, or the row style. For a cell that does not have the Font.Facename property set, the Font.Facename property of the row style is checked, then the column style, and finally the standard style. So, to change the default setting, you can change the setting to the standard style. The standard style is the basestyle stored within the grid’s basestyle.

C#

//Set the default style of the font to bold.
GridStyleInfo standard = this.gridControl1.BaseStylesMap["Standard"].StyleInfo;
standard.Font.Bold = true;

VB

'Set the default style of the font to bold.
Dim standard As GridStyleInfo = Me.gridControl1.BaseStylesMap("Standard").StyleInfo
standard.Font.Bold = True

After applying the properties, the output looks as follows:

Default style of the text set to bold

Figure 1: Default style of the text set to bold

Samples:

C#: Default font style

VB: Default font style

 

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