Spread Windows Forms 6.0 Product Documentation
SetFormulaConditionalFormat(Int32,Int32,NamedStyle,String) Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class > SetFormulaConditionalFormat Method : SetFormulaConditionalFormat(Int32,Int32,NamedStyle,String) Method


row
Row index of the cell
column
Column index of the cell
style
Style to be applied to the cell if the formula evaluates to true
formula
Formula to evaluate for the condition

Glossary Item Box

Sets conditional formatting for a specified cell on the sheet based on a specified formula.

Syntax

Visual Basic (Declaration) 
Public Overloads Function SetFormulaConditionalFormat( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal style As NamedStyle, _
   ByVal formula As String _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim row As Integer
Dim column As Integer
Dim style As NamedStyle
Dim formula As String
Dim value As Boolean
 
value = instance.SetFormulaConditionalFormat(row, column, style, formula)
C# 
public bool SetFormulaConditionalFormat( 
   int row,
   int column,
   NamedStyle style,
   string formula
)

Parameters

row
Row index of the cell
column
Column index of the cell
style
Style to be applied to the cell if the formula evaluates to true
formula
Formula to evaluate for the condition

Example

This sets a conditional format for the specified cell.
C#Copy Code
FarPoint.Win.Spread.NamedStyle style = new FarPoint.Win.Spread.NamedStyle();
style.BackColor = Color.Cyan;
fpSpread1.ActiveSheet.SetFormulaConditionalFormat(0, 0, style, "A1 = 10");
fpSpread1.ActiveSheet.Cells[0, 0].Value = 10;
Visual BasicCopy Code
Dim style As New FarPoint.Win.Spread.NamedStyle
style.BackColor = Color.Cyan
FpSpread1.ActiveSheet.SetFormulaConditionalFormat(0, 0, style, "A1 = 10")
FpSpread1.ActiveSheet.Cells(0, 0).Value = 10

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

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