Conditional Styles

You can add conditional styles on controls to apply a specific format when a condition you set is True. Use conditional styles individually or with Styles.

Adding a Conditional Style to a Control

In the example below, a Radio Button List control contains the values Pass and Fail. If you select the Pass option, the background color of the control changes to green. If you select the Fail option, the background color of the control changes to red. Use the following steps to configure this conditional style:

  1. Create a view and add a Radio Button List control.
  2. Configure the control with the values Pass and Fail.
  3. Select the control and click the ellipsis next to Conditional Styles in the control's Properties.
  4. Click Add to open the Add Conditional Formatting page.
  5. Click Add under Conditions.
  6. Specify the condition name, and then drag the Radio Button List control from the Context Browser into the left condition field and type the word Pass in the right condition field. Note the Preview at the bottom. Click OK. You can add more complex conditions by adding more than one condition and using Expressions to control how they are logically related. Use Preview to verify the statement.
  7. Next, the Style Builder opens. Configure the background color to change to green when you select the Pass option. Click OK.
  8. Repeat the steps for the Fail condition.
  9. When the Style Builder opens, configure the background color to change to red when you select the Fail option.
  10. The conditions are listed as shown below:
  11. Finish and run the view.
  12. When you select Pass, the background color changes to green:
  13. When you select Fail, the background color changes to red: