Spread for ASP.NET 11 Product Documentation
ComparisonOperator Property
Example 


FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > ConditionalFormat Class : ComparisonOperator Property
Gets or sets the comparison operator for the conditional format.
Syntax
'Declaration
 
Public Property ComparisonOperator As ComparisonOperator
'Usage
 
Dim instance As ConditionalFormat
Dim value As ComparisonOperator
 
instance.ComparisonOperator = value
 
value = instance.ComparisonOperator
public ComparisonOperator ComparisonOperator {get; set;}

Property Value

ComparisonOperator object containing the comparison operator
Example
This example returns the first condition.
FarPoint.Web.Spread.NamedStyle styleCold = new FarPoint.Web.Spread.NamedStyle(); 
FarPoint.Web.Spread.NamedStyle styleCool = new FarPoint.Web.Spread.NamedStyle(); 
FarPoint.Web.Spread.NamedStyle styleMild = new FarPoint.Web.Spread.NamedStyle(); 
FarPoint.Web.Spread.NamedStyle styleWarm = new FarPoint.Web.Spread.NamedStyle(); 
FarPoint.Web.Spread.NamedStyle styleHot = new FarPoint.Web.Spread.NamedStyle(); 
styleCold.BackColor = Color.Blue; 
styleCold.ForeColor = Color.White; 
styleCool.BackColor = Color.Cyan; 
styleMild.BackColor = Color.Lime; 
styleWarm.BackColor = Color.Yellow; 
styleHot.BackColor = Color.Red; 
FarPoint.Web.Spread.ComparisonOperator co = new FarPoint.Web.Spread.ComparisonOperator(); 
FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleCold, FarPoint.Web.Spread.ComparisonOperator.LessThan, "32"); 
FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleCool, FarPoint.Web.Spread.ComparisonOperator.Between, "32", "55");

FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleMild, FarPoint.Web.Spread.ComparisonOperator.Between, "55", "75");

FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleWarm, FarPoint.Web.Spread.ComparisonOperator.Between, "75", "85");

FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleHot, FarPoint.Web.Spread.ComparisonOperator.GreaterThan, "85");

FpSpread1.ActiveSheetView.Cells[1, 1].Value = 38; 
FarPoint.Web.Spread.ConditionalFormat[] cf; 
FarPoint.Web.Spread.ConditionalFormat item = new FarPoint.Web.Spread.ConditionalFormat(styleCool); 
cf = FpSpread1.ActiveSheetView.GetConditionalFormats(1, 1, false); 
foreach (int item in cf) { 
 string msg = "The first condition is " + item.FirstCondition.ToString(); 
 Response.Write("alert('" + msg + "')"); 
}
Dim styleCold As New FarPoint.Web.Spread.NamedStyle
Dim styleCool As New FarPoint.Web.Spread.NamedStyle
Dim styleMild As New FarPoint.Web.Spread.NamedStyle
Dim styleWarm As New FarPoint.Web.Spread.NamedStyle
Dim styleHot As New FarPoint.Web.Spread.NamedStyle
styleCold.BackColor = Color.Blue
styleCold.ForeColor = Color.White
styleCool.BackColor = Color.Cyan
styleMild.BackColor = Color.Lime
styleWarm.BackColor = Color.Yellow
styleHot.BackColor = Color.Red

Dim co As New FarPoint.Web.Spread.ComparisonOperator
FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleCold, FarPoint.Web.Spread.ComparisonOperator.LessThan, "32")
FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleCool, FarPoint.Web.Spread.ComparisonOperator.Between, "32", "55")
FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleMild, FarPoint.Web.Spread.ComparisonOperator.Between, "55", "75")
FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleWarm, FarPoint.Web.Spread.ComparisonOperator.Between, "75", "85")
FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleHot, FarPoint.Web.Spread.ComparisonOperator.GreaterThan, "85")

FpSpread1.ActiveSheetView.Cells(1, 1).Value = 38

Dim cf As FarPoint.Web.Spread.ConditionalFormat()
Dim item As New FarPoint.Web.Spread.ConditionalFormat(styleCool)
cf = FpSpread1.ActiveSheetView.GetConditionalFormats(1, 1, False)
For Each item In cf
Dim msg As String = "The first condition is " & item.FirstCondition.ToString()
Response.Write("alert('" & msg & "')")
Next
See Also

Reference

ConditionalFormat Class
ConditionalFormat Members