Spread Windows Forms 6.0 Product Documentation
SetFormulaConditionalFormat(Int32,Int32,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,Int32,Int32,NamedStyle,String) Method


row
Starting row index
column
Starting column index
rowCount
Number of rows
columnCount
Number of columns
style
Style to be applied to the cell if the formula evaluates to true
formula
Formula for the condition

Glossary Item Box

Sets conditional formatting on a specified range of cells 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 rowCount As Integer, _
   ByVal columnCount 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 rowCount As Integer
Dim columnCount As Integer
Dim style As NamedStyle
Dim formula As String
Dim value As Boolean
 
value = instance.SetFormulaConditionalFormat(row, column, rowCount, columnCount, style, formula)
C# 
public bool SetFormulaConditionalFormat( 
   int row,
   int column,
   int rowCount,
   int columnCount,
   NamedStyle style,
   string formula
)

Parameters

row
Starting row index
column
Starting column index
rowCount
Number of rows
columnCount
Number of columns
style
Style to be applied to the cell if the formula evaluates to true
formula
Formula 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, 2, 2, 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, 2, 2, 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.