The font style of a column can be set either in the designer or in code.
To set the font style using the C1TrueDBGrid Tasks menu, complete the following steps:
Alternatively, the font style can also be set through the C1TrueDBGrid Designer. To set the font style using the designer:
To set the font style using code, complete the following steps:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Dim fntFont As Font |
To write code in C#
C# |
Copy Code
|
---|---|
Font fntFont; |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
fntFont = New Font("Times New Roman", Me.C1TrueDBGrid1.Splits(0).DisplayColumns.Item("Country").Style.Font.Size, FontStyle.Bold) Me.C1TrueDBGrid1.Splits(0).DisplayColumns.Item("Country").Style.Font = fntFont |
To write code in C#
C# |
Copy Code
|
---|---|
fntFont = new Font("Times New Roman", this.c1TrueDBGrid1.Splits[0].DisplayColumns["Country"].Style.Font.Size, FontStyle.Bold); this.c1TrueDBGrid1.Splits[0].DisplayColumns["Country"].Style.Font = fntFont; |
In this example, the rows of the Country column are now Times New Roman font and bold:
For more information on specifying cell styles, see Applying Styles to Cells.