Apply conditional formatting to a Data View
With conditional formatting, you can create a Data View that applies a style to a selected HTML tag or data value when the data meets criteria that you specify. You can also set conditions that change the visibility of an HTML tag or data value, so you can show or hide data altogether.
With Microsoft Expression Web, you can use XML Path Language (XPath) to build expressions that specify conditions for when to apply conditional formatting. XPath is a language for locating and processing information in an XML document. Expression Web makes it possible for both novices and advanced users to create XPath expressions that perform complex functions on XML data.
With the page in Design view, right-click the Data View, and then click Conditional Formatting. The Conditional Formatting panel opens.
In the Data View, select any cell other than the header cell, such as the HTML tag, data value, or range of text in the field that you want to format.
To quickly select the entire cell, right-click inside the cell, point to Select on the shortcut menu, and then click Cell.
In the Conditional Formatting panel, click Create, and then click Apply Formatting.
If the Create button is not available, the selection cannot have conditional formatting applied to it.
In the Condition Criteria dialog box, click anywhere in the first row to add a new clause, and then do the following:
Under Field Name, click the arrow, and then click the field that you want in the list.
Under Comparison, click the arrow, and then click the comparison that you want.
Under Value, click the arrow, and then click More Fields. In the More Fields dialog box, click the field that you want, and then click OK.
By using the AND and OR operators and adding additional clauses, you can create criteria that specify multiple conditions.
Now that you have created the condition, you can apply the formatting:
In the Condition Criteria dialog box, click OK.
In the Modify Style dialog box, choose options to create the style for your conditional formatting.
Because a Data View is a view of live data, you see the conditional formatting applied immediately in Design view.