GrapeCity MultiRow Windows Forms Documentation
Change BackColor (ButtonCell)

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

Change backcolor of Button cell 1 Change backcolor of Button cell 2

In an environment where the visual style is enabled, the backcolor set using the ButtonCell.Style.BackColor property is not applied to the button if either the ButtonCell.FlatStyle property is set as System or the ButtonCell.UseVisualStyleBackColor property is set to True. The effect is only applied to the background of the button. The image below shows an example of a button background set by changing the ButtonCell.Style.Padding property.

Change backcolor of Button cell 3

Using the Designer

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

Using Code

This example sets style and colors for the button cell.

[VB]

Imports GrapeCity.Win.MultiRow

Dim template As New Template
Dim buttonCell1 As New ButtonCell()

buttonCell1.Name = "buttonCell1"
buttonCell1.Value = "Button"
buttonCell1.Style.BackColor = Color.FromArgb(255, 192, 192)
buttonCell1.UseVisualStyleBackColor = False
buttonCell1.FlatStyle = FlatStyle.Standard

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

[CS]

using GrapeCity.Win.MultiRow;

Template template = new Template();
ButtonCell buttonCell1 = new ButtonCell();

buttonCell1.Name = "buttonCell1";
buttonCell1.Value = "Button";
buttonCell1.Style.BackColor = Color.FromArgb(255, 192, 192);
buttonCell1.UseVisualStyleBackColor = false;
buttonCell1.FlatStyle = FlatStyle.Standard;

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

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options