GrapeCity MultiRow Windows Forms Documentation
Change BackColor (HeaderCell)

You can change the header cell backcolor by setting any color in the HeaderCell.Style.BackColor property and then using any of the following settings.

Change BackColor of HeaderCell2Change BackColor of HeaderCell1

In an environment where a visual style is enabled, the backcolor set using the HeaderCell.Style.BackColor property is not applied to the button if either the HeaderCell.FlatStyle property is set to System or the HeaderCell.UseVisualStyleBackColor property is set to True.

Using the Designer

  1. Select a button cell whose back color needs to be changed (For example: headerCell1).
  2. From the Properties window, select the HeaderCell.Style.BackColor property and choose any color from the drop-down.
  3. From the Properties window, select the HeaderCell.UseVisualStyleBackColor property and set it to False.
  4. From the Properties window, select the HeaderCell.FlatStyle property and either set it to Flat, Popup, or Standard.

Using Code

The following code sets the backcolor for the header cell.

[VB]

Imports GrapeCity.Win.MultiRow

Dim template As New Template
Dim headerCell1 As New HeaderCell()

headerCell1.Name = "headerCell1"
headerCell1.Value = "HeaderCell"
headerCell1.Style.BackColor = Color.FromArgb(192, 255, 192)
headerCell1.Style.Border = New Border(LineStyle.Thin, Color.DarkGray)
headerCell1.UseVisualStyleBackColor = false
headerCell1.FlatStyle = FlatStyle.Standard

GcMultiRow1.Template = Template.CreateGridTemplate(New Cell() { headerCell1 })
GcMultiRow1.RowCount = 10

[CS]

using GrapeCity.Win.MultiRow;

Template template = new Template();
HeaderCell headerCell1 = new HeaderCell();

headerCell1.Name = "headerCell1";
headerCell1.Value = "HeaderCell";
headerCell1.Style.BackColor = Color.FromArgb(192, 255, 192);
headerCell1.Style.Border = new Border(LineStyle.Thin, Color.DarkGray);
headerCell1.UseVisualStyleBackColor = false;
headerCell1.FlatStyle = FlatStyle.Standard;

gcMultiRow1.Template = Template.CreateGridTemplate(new Cell[] { headerCell1 });
gcMultiRow1.RowCount = 10;
See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options