Spread for ASP.NET 13 Product Documentation
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread Namespace / ConditionalFormat Class / FirstCondition Property
Example


In This Topic
    FirstCondition Property (ConditionalFormat)
    In This Topic
    Gets or sets the first condition.
    Syntax
    'Declaration
     
    Public Property FirstCondition As String
    'Usage
     
    Dim instance As ConditionalFormat
    Dim value As String
     
    instance.FirstCondition = value
     
    value = instance.FirstCondition
    public string FirstCondition {get; set;}

    Property Value

    String containing the first condition
    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