| True DBGrid for WinForms Task-Based Help > Setting the Grid's Appearance > Adding a Gradient Fill to a Column |
To add a gradient fill to a column, set the GradientMode, BackColor, and BackColor2 properties. Also, setting the GammaCorrection property to True to apply the gradient with a more uniform intensity. These properties can be set either in the designer or in code.
Complete the following steps to set the gradient fill using the C1TrueDBGrid Tasks menu:



Alternatively, the gradient fill can also be set through the C1TrueDBGrid Designer. To set the gradient fill using the designer, complete the following:

To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Me.C1TrueDBGrid1.Splits(0).DisplayColumns("Last").Style.GradientMode = C1.Win.C1TrueDBGrid.GradientModeEnum.ForwardDiagonal
|
|
To write code in C#
| C# |
Copy Code
|
|---|---|
this.c1TrueDBGrid1.Splits[0].DisplayColumns["Last"].Style.GradientMode = C1.Win.C1TrueDBGrid.GradientModeEnum.ForwardDiagonal; |
|
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Me.C1TrueDBGrid1.Splits(0).DisplayColumns("Last").Style.BackColor2 = Color.Aqua
|
|
To write code in C#
| C# |
Copy Code
|
|---|---|
this.c1TrueDBGrid1.Splits[0].DisplayColumns["Last"].Style.BackColor2 = Color.Aqua; |
|
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Me.C1TrueDBGrid1.Splits(0).DisplayColumns("Last").Style.GammaCorrection = True
|
|
To write code in C#
| C# |
Copy Code
|
|---|---|
this.c1TrueDBGrid1.Splits[0].DisplayColumns["Last"].Style.GammaCorrection = true; |
|
The Last column has a white to aqua, forward diagonal gradient fill: