ComponentOne True DBGrid for WinForms
Adding a Gradient Fill to a Column
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 GradientModeBackColor, 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.

In the Tasks Menu

Complete the following steps to set the gradient fill using the C1TrueDBGrid Tasks menu:

  1. Select the Last column in the grid and click it to open the C1TrueDBGrid Tasks menu.
  2. Select Column Style from the menu.
  3. Click the Fill Effects tab.
  4. Set BackColor 2 to Aqua.
  5. Set Gradient mode to ForwardDiagonal.
  6. Check the Gamma correction box.
  7. Click Ok to close the Column Style(Last) dialog box.

In the Designer

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

  1. Open the C1TrueDBGrid Designer. For information on how to access the C1TrueDBGrid Designer, see Accessing the C1TrueDBGrid Designer.
  2. Select the Last column by clicking it in the right pane.
    The column can also be selected by choosing Last from the drop-down list in the toolbar.
  3. Click the Display Column tab in the left pane.
  4. Click the ellipsis button next to the Style property to open the Style Editor.
  5. In the Style Editor, click the Fill Effects tab.
  6. Set BackColor 2 to Aqua.
  7. Set Gradient mode to ForwardDiagonal.
  8. Check the Gamma correction box.
  9. Click Ok to close the Style Editor.
  10. Click OK to close the C1TrueDBGrid Designer.

In Code

  1. Set GradientMode to ForwardDiagonal by adding the following code to the Form_Load event:

    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;
    
  2. Set BackColor2 to Aqua:

    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;
    
  3. Set GammaCorrection to True:

    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;
    

What You've Accomplished

The Last column has a white to aqua, forward diagonal gradient fill: