Spread for ASP.NET 7.0 Product Documentation
FirstCondition Property
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > ConditionalFormat Class : FirstCondition Property


Glossary Item Box

Gets or sets the first condition.

Syntax

Visual Basic (Declaration) 
Public Property FirstCondition As String
Visual Basic (Usage)Copy Code
Dim instance As ConditionalFormat
Dim value As String
 
instance.FirstCondition = value
 
value = instance.FirstCondition
C# 
public string FirstCondition {get; set;}

Property Value

String containing the first condition

Example

This example returns the first condition.
C#Copy Code
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 + "')"); 
}
Visual BasicCopy Code
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

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.