GrapeCity MultiRow Windows Forms Documentation
Background Gradation

You can set the background gradation in the cell style. The gradation supported in MultiRow is based upon the rendering feature of gradation used in the .NET Framework.

The following image shows the application of Color.Red and Color.Blue in the CellStyle.BackgroundGradientEffect.Colors property.

CellStyle.BackgroundGradientEffect.Direction CellStyle.BackgroundGradientEffect.Style Application Image
Inherit Horizontal
Inherit Vertical
Inherit DiagonalUp
Inherit DiagonalDown
Forward CornerUp
Forward CornerDown
Inherit Rectangular

Using the Designer

  1. Select the cells where gradation needs to be set (for example: textBoxCell1).
  2. Select the textBoxCell1 Style.BackgroundGradientEffect property in the Properties window and click the ... (ellipsis) button.
  3. On the GradientEffect editor, select Multiple Colors under the Color section.
  4. Click the Add button and enter Green in Selected Color.
  5. Select Add in the GradientEffect collection editor again, and enter Yellow in Selected Color.
  6. Select Style in the bottom-left of the screen, and select Horizontal.
  7. Select Direction in the bottom-center of the screen and select bottom-right (Side).
  8. Select OK and close the GradientEffect Editor.

The following image displays the GradientEffect Editor.

Using Code

The following code creates a gradation.

[VB]

Imports GrapeCity.Win.MultiRow

Dim gradientEffect1 As New GradientEffect()
gradientEffect1.Colors = New Color() {Color.Green, Color.Yellow}
gradientEffect1.Style = GradientStyle.Horizontal
gradientEffect1.Direction = GradientDirection.Side

Dim textBoxCell1 As New TextBoxCell()
textBoxCell1.Style.BackgroundGradientEffect = gradientEffect1

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


[CS]

using GrapeCity.Win.MultiRow;

GradientEffect gradientEffect1 = new GradientEffect();
gradientEffect1.Colors = new Color[] {Color.Green, Color.Yellow};
gradientEffect1.Style = GradientStyle.Horizontal;
gradientEffect1.Direction = GradientDirection.Side;

TextBoxCell textBoxCell1 = new TextBoxCell();
textBoxCell1.Style.BackgroundGradientEffect = gradientEffect1;

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


See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options