Conditional Row Style
Description
Conditional styling applied to each row in the list. Styling can be computed using a server-side or client-side expression.
Discussion
The conditional styling lets you format list data conditionally, depending on its value. For example, you might want to set the background color to red for an overdue invoice or apply different font weights to each record based on a field containing state information.
Conditional styling can be computed either on the server or the client. If computed on the server, the styling is applied before the List data is sent to the client.
If computed on the client, the styling is applied after List data has been downloaded to the client.
Conditional styling is only applied if the condition evaluates to true. A condition can reference one or more values in the List row, as well as summary data (if it is available.)
Alternating row color
If enabled, applies alternating row colors to even and odd rows in the List control. The colors used are specified by the Even row color and Odd row color properties.
If enabled, the Server-side computation and Client-side computation cannot be used to conditionally style rows in the List control.
Even row color
A background color applied to all even rows in the List control. The color is a CSS color value. Use the [...] smart field button to use the Color Picker to select a color for the Even row color.
This property is only available when Alternating row color is enabled.
Odd row color
A background color applied to all odd rows in the List control. The color is a CSS color value. Use the [...] smart field button to use the Color Picker to select a color for the Odd row color.
This property is only available when Alternating row color is enabled.
Server-side computation
A Server-side computation is done on the server. The condition is specified using Xbasic syntax. To recompute conditional row styling done using a server-side computation, an ajax callback must be made to refresh the List.
This property is only available when Alternating row color is disabled.
Client-side computation
A Client-side computation is done on the client. Because the computation is made in the client, you do not need to make a callback to the server to re-compute the styling.
The condition can be specified using either Intermediate Syntax or JavaScript Syntax.
This property is only available when Alternating row color is disabled.
Intermediate syntax
Intermediate syntax is a special syntax that gets converted into JavaScript. The syntax is similar to Portable SQL Syntax. To use Intermediate syntax, select the Intermediate syntax - gets converted to Javascript radio button.
JavaScript syntax
The alternative to Intermediate syntax is to use JavaScript syntax directly to define the condition. To do this, select the Pure Javascript syntax radio button.
Videos
Alternating Row Colors
In this video we show how you can configure a List control to show alternating colors for even and odd rows.
See Also