To change the font style of a column, set the Style.Font property either in the designer or in code.
Add the following code, in this example the code was added to the Button1_Click event.
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Dim fntFont As Font fntFont = New Font("Impact", Me.C1List1.Splits(0).DisplayColumns.Item("Company").Style.Font.Size, FontStyle.Italic) Me.C1List1.Splits(0).DisplayColumns.Item("Company").Style.Font = fntFont |
To write code in C#
C# |
Copy Code
|
---|---|
Font fntFont; fntFont = new Font("Impact", this.c1List1.Splits[0].DisplayColumns["Company"].Style.Font.Size, FontStyle.Italic); this.c1List1.Splits[0].DisplayColumns["Company"].Style.Font = fntFont; |
When the Font Style button is clicked, the font in the Company column is changed to Impact and italic.