Contents > CFML Reference > ColdFusion Tags > cfgridcolumn > Using expressions in textColor and bgColor attributes PreviousNext

Using expressions in textColor and bgColor attributes

The textColor and bgColor attributes accept the following kinds of values:

The syntax for an expression is as follows:

(CX operator string ? true_condition : false_condition)

The symbol meanings are as follows:

If the string in the expression can be interpreted as a number, the comparisons in the expression are interpreted as numeric. Otherwise, the comparison is a string comparison.

This code shows an expression that displays the grid element in blue if the grid element contains the string "Pam"; or black, otherwise:

<cfgridcolumn name = "FirstName" textColor = "(CX EQ Pam ? blue : black)">

This example displays the text in red if the value in column 1 is greater than four; or black, otherwise:

<cfgridcolumn name = "FirstName" textColor = "(C1 GT 4 ? blue : black)">

Contents > CFML Reference > ColdFusion Tags > cfgridcolumn > Using expressions in textColor and bgColor attributes PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-p52.htm