ComponentOne Reports for WinForms Designer Edition: ComponentOne Reports for WinForms > Printing and Previewing Task-Based Help > Formatting Tables > Changing the Background Color of Rows and Columns

Changing the Background Color of Rows and Columns

To change the background color of rows and columns in a table, set the BackColor property of the row and column.

Note: The column BackColor property overrides the row BackColor property.

Add the following code to the Form_Load event before the Add and Generate methods:

      Visual Basic

' Set the Column color.

table.Cols(0).Style.BackColor = Color.PapayaWhip

 

' Set the Row color.

table.Rows(0).Style.BackColor = Color.PaleTurquoise

      C#

// Set the Column color.

table.Cols[0].Style.BackColor = Color.PapayaWhip;

 

// Set the Row color.

table.Rows[0].Style.BackColor = Color.PaleTurquoise;

 What You've Accomplished

The first column in the table is PapayaWhip and the first row in the table is PaleTurquoise:

 


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.