Shading and Dividers PropertiesConditional Style (Server-Side)

Description

Applies custom CSS styling to rows in the Grid that match a Condition. The Condition is computed on the server.

Discussion

You can use the Conditional style property to set conditional styles for rows in the Grid. This property can be used to call out data in the Grid that requires special attention. For example, this property could be used to highlight overdue invoices or client jobs that are not assigned to an employee.

If the conditional expression evaluates to true, the styling is applied to the Grid row. If multiple expressions evaluate to true for a row, the first expression is applied.

The conditional expressions can refer to values in the Grid row as well as summary values. Field names can be inserted using the Insert Fieldname link. Insert Function can be used to insert a function from a list of functions available for use in the server-side computation.

The Conditional style (server-side) is evaluated on the server before the data for the Grid is downloaded. If you are displaying a large number of records, conditional server-side styling can have a negative performance impact. If you experience poor performance using the Conditional style (server-side), consider using the Conditional style (client-side) instead to apply dynamic styling.

Conditional Style (server-side) dialog
Conditional Style (server-side) dialog

Rules for Expressions

The Conditional style (server-side) expressions are written using Xbasic syntax (examples below):

  • Logical operators are .and., .or., and .not..
  • String literals are defined using double quotes.
Example Expressions
quantity > 100 .and. quantity < 200
state = "MA"

Using Summary Values

If a field has a summary value calculation, the summary value can be referenced in the expression using the syntax:

summary.fieldname.summary_type

where fieldname is the field's name and summary_type is the type of summary calculation. For example, if you have enabled Average for a field called quantity, the summary value is referenced as:

summary.quantity.average

If the field name contains a space (e.g. "quantity ordered"), the space is replaced with an underscore:

summary.quantity_ordered.average

See Summary Values to learn how to enable summary values for a field.