Spread for ASP.NET 7.0 Product Documentation
UnaryComparisonConditionalFormattingRule Constructor(UnaryComparisonOperator,String,Boolean)
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > UnaryComparisonConditionalFormattingRule Class > UnaryComparisonConditionalFormattingRule Constructor : UnaryComparisonConditionalFormattingRule Constructor(UnaryComparisonOperator,String,Boolean)


operator
The @operator.
text
The string value.
isFormula
The boolean value indicates whether the text is a formula.

Glossary Item Box

Initializes a new instance of the UnaryComparisonConditionalFormattingRule class.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal operator As UnaryComparisonOperator, _
   ByVal text As String, _
   ByVal isFormula As Boolean _
)
Visual Basic (Usage)Copy Code
Dim operator As UnaryComparisonOperator
Dim text As String
Dim isFormula As Boolean
 
Dim instance As New UnaryComparisonConditionalFormattingRule(operator, text, isFormula)
C# 
public UnaryComparisonConditionalFormattingRule( 
   UnaryComparisonOperator operator,
   string text,
   bool isFormula
)

Parameters

operator
The @operator.
text
The string value.
isFormula
The boolean value indicates whether the text is a formula.

Example

This example uses a formula to evaluate the value in the rule.
C#Copy Code
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 = 4;
    FpSpread1.Sheets[0].Cells[0, 1].Value = 1;   
    //Unary comparison CF
    FarPoint.Web.Spread.UnaryComparisonConditionalFormattingRule unary = new FarPoint.Web.Spread.UnaryComparisonConditionalFormattingRule(FarPoint.Web.Spread.UnaryComparisonOperator.EqualTo, "=A1+B1", true);
    unary.Formula = "=A1+B1";
    unary.BackColor = System.Drawing.Color.Red;
    unary.FontStyle = new FarPoint.Web.Spread.SpreadFontStyle(FarPoint.Web.Spread.UnderlineFontStyle.None);
    unary.FontStyle.RegularBoldItalic = FarPoint.Web.Spread.RegularBoldItalicFontStyle.Bold;
    FpSpread1.ActiveSheetView.SetConditionalFormatting(1, 1, unary);      
}
VB.NETCopy Code
Protected Sub Page_Load(sender As Object, e As EventArgs)
If Me.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 = 4
FpSpread1.Sheets(0).Cells(0, 1).Value = 1
'Unary comparison CF
Dim unary As New FarPoint.Web.Spread.UnaryComparisonConditionalFormattingRule(FarPoint.Web.Spread.UnaryComparisonOperator.EqualTo, "=A1+B1", True)
unary.Formula = "=A1+B1"
unary.BackColor = System.Drawing.Color.Red
unary.FontStyle = New FarPoint.Web.Spread.SpreadFontStyle(FarPoint.Web.Spread.UnderlineFontStyle.None)
unary.FontStyle.RegularBoldItalic = FarPoint.Web.Spread.RegularBoldItalicFontStyle.Bold
FpSpread1.ActiveSheetView.SetConditionalFormatting(1, 1, unary)
End Sub

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.