Saturday, May 17, 2008  



 FarPoint Technologies
 (800) 645-5913

 fpsales@fpoint.com

 FarPoint Europe (UK)
 +44 (0) 1798 812 372

 salesEurope@fpoint.com

     
 »Spread for Web Forms » Product Tour » Conditional Formatting

Previous Conditional Formatting Next

You can set up conditional formats within cells that determine the formatting of the cell based on the outcome of a conditional statement. You can use a named style to specify various formatting options such as borders and colors to apply if the condition statement is valid, that is, if the operation is satisfied.

For example, you may want to change the background color of a cell based on the value of the cell. If the value is below 100 then the background color would be changed to red. The condition statement is "less than 100" and consists of a comparison operator "less than" and a condition, in this case a single constant "100". The condition can be a constant (expressed as a string) or an expression. Some condition statements have two conditions and an operator: for instance, if the cell value is between 0 and 100, then change the background color. In this case, the comparison operator is "between" and the first condition is 0 and the last condition is 100. For a complete list of operations, refer to the ComparisonOperator enumeration.

Type a number in the highlighted box below. If the number is less than 20, the backcolor will turn red and forecolor yellow. If the number is greater than 40, the the backcolor will turn blue and forecolor light green.
 ABCD
1    
2    
3    
   



'Define Conditions
'row, column, NamedStyle, condition, value
FpSpread1.Sheets(0).SetConditionalFormat(1, 1, ns, FarPoint.Web.Spread.ComparisonOperator.LessThan, "20")

FpSpread1.Sheets(0).SetConditionalFormat(1, 1, ns2, FarPoint.Web.Spread.ComparisonOperator.GreaterThan, "40")
    
 Have a question?
Have a Question? Ask Us!
Subscribe to the RSS feed!RSS Subscribe
 

 
SD Times 'TOP 100' Industry Innovator - Read the press release (pdf)

Tour Home
AJAX Support
Cell Merging
Conditional Formatting
Customer Usability
Customization
Data Binding
Editing
Excel Compatibility
Filtering
Formulas
Frozen Rows & Columns
Grouping
Hierarchy
Import / Export
Interaction
Load on Demand
Move Columns
Object Model
Operation Modes
Optimizing
Order Entry Sample
Protect that Data
Searching
Sheets
Skins
Sorting
Spread Designer
Unbound Mode
Worksheet
Please rate tour

Copyright © 1991-2007 FarPoint Technologies, Inc. All rights reserved. All names are property of their respective owners.