Spread for ASP.NET 10 Product Documentation
TwoColorScaleConditionalFormattingRule Constructor(ConditionalFormattingColorValue,ConditionalFormattingColorValue)
Example 


The minimum value. Note: The minimum value only accepts the ConditionalFormattingColorValue object which has a Type value of Min, Number, Percent, Formula, or Pecentile.
The maximum value. Note: The maximum value only accepts the ConditionalFormattingColorValue object which has a Type value of Max, Number, Percent, Formula, or Pecentile.
Initializes a new instance of the TwoColorScaleConditionalFormattingRule class.
Syntax
'Declaration
 
Public Function New( _
   ByVal minValue As ConditionalFormattingColorValue, _
   ByVal maxValue As ConditionalFormattingColorValue _
)
'Usage
 
Dim minValue As ConditionalFormattingColorValue
Dim maxValue As ConditionalFormattingColorValue
 
Dim instance As New TwoColorScaleConditionalFormattingRule(minValue, maxValue)
public TwoColorScaleConditionalFormattingRule( 
   ConditionalFormattingColorValue minValue,
   ConditionalFormattingColorValue maxValue
)

Parameters

minValue
The minimum value. Note: The minimum value only accepts the ConditionalFormattingColorValue object which has a Type value of Min, Number, Percent, Formula, or Pecentile.
maxValue
The maximum value. Note: The maximum value only accepts the ConditionalFormattingColorValue object which has a Type value of Max, Number, Percent, Formula, or Pecentile.
Example
This example creates a two color scale rule.
protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsPostBack) return;
            FpSpread1.Sheets[0].Cells[0, 0].Value = 3;
            FpSpread1.Sheets[0].Cells[1, 0].Value = 2;
            FpSpread1.Sheets[0].Cells[1, 1].Value = 10;
            FpSpread1.Sheets[0].Cells[0, 2].Value = 1;
            FarPoint.Web.Spread.TwoColorScaleConditionalFormattingRule two = new FarPoint.Web.Spread.TwoColorScaleConditionalFormattingRule(new FarPoint.Web.Spread.ConditionalFormattingColorValue(System.Drawing.Color.Yellow, 1, FarPoint.Web.Spread.ConditionalFormattingValueType.Min), new FarPoint.Web.Spread.ConditionalFormattingColorValue(System.Drawing.Color.Orange, 10, FarPoint.Web.Spread.ConditionalFormattingValueType.Max));
            FpSpread1.ActiveSheetView.SetConditionalFormatting(0, 0, 2, 2, two);
        }
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (IsPostBack) Then
            Return
        End If
        FpSpread1.Sheets(0).Cells(0, 0).Value = 3
        FpSpread1.Sheets(0).Cells(1, 0).Value = 2
        FpSpread1.Sheets(0).Cells(1, 1).Value = 10
        FpSpread1.Sheets(0).Cells(0, 2).Value = 1
        Dim two As New FarPoint.Web.Spread.TwoColorScaleConditionalFormattingRule(New FarPoint.Web.Spread.ConditionalFormattingColorValue(System.Drawing.Color.Yellow, 1, FarPoint.Web.Spread.ConditionalFormattingValueType.Min), New FarPoint.Web.Spread.ConditionalFormattingColorValue(System.Drawing.Color.Orange, 10, FarPoint.Web.Spread.ConditionalFormattingValueType.Max))
        FpSpread1.ActiveSheetView.SetConditionalFormatting(0, 0, 2, 2, two)
    End Sub
Requirements

Target Platforms: Windows 7, Windows 8, Windows 10, Windows Vista, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows XP Professional

See Also

Reference

TwoColorScaleConditionalFormattingRule Class
TwoColorScaleConditionalFormattingRule Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.