ComponentOne Preview Classic for WinForms: Preview Classic for WinForms Task-Based Help > 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 row BackColor property overrides the column BackColor property.

Add the following code to the Form_Load event:

      Visual Basic

Dim table As C1.C1PrintDocument.RenderTable = New C1.C1PrintDocument.RenderTable(Me.C1PrintDocument1)

 

' Set the Row color.

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

 

' Set the Column color.

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

      C#

C1.C1PrintDocument.RenderTable table = new C1.C1PrintDocument.RenderTable(this.c1PrintDocument1);

 

// Set the Row color.

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

 

// Set the Column color.

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

This topic illustrates the following:

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

 


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