MultiRow Windows Forms > Developer's Guide > Using MultiRow > Cell Types > HeaderCell > 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.
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.
The following code sets the backcolor for the header cell.
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 |
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; |