Freigeben über


Grokking "Show Visibility" in the Conditional Formatting Task Pane

Sometimes true Wysiwyg is not what you want in design view. For example, if you are using Conditional Formatting to optionally show content in your view, and your data is such that all records evaluate to false, you end up in a situation where you can no longer select the tag that holds the Conditional Formatting. To address this issue, we build a little feature into the Conditional Formatting task pane called "Set Visibility", which allows you to force the Conditional Formatting "on/off" states, regardless of what the "conditional" evaluates to.

The "Set Visibility" button has three options (note: these are only available if CondF is applied to the view):
1) Default
2) All formatting hidden
3) All formatting visible

When we initially designed the feature, we had it so that "All formatting hidden" was the equivalent of forcing all "conditionals" to evaluate to false, and "All formatting visible" forced everything to evaluate to true. The problem we ran into with this design was that the resulting behavior was a little unexpected, e.g. "All formatting hidden" would cause every "Show Content" Conditional Formatting to disappear, since that's what happens when the conditionalal evaluates to false.

Since we didn't think that was the user's expectation, we changed the design so that "All formatting hidden" showed the view as if no Conditional Formatting had been applied, which translates underneath the covers to forcing "Show Content" CondF's to evaluate to true, and "Hide Content/Apply Formatting" CondF's to evaluate to false.

For the "All formatting visible" option, we left the design of that one alone - underneath the covers, it forces all conditionals to true, which means that the Show/Apply formatting are there for every row, and any content with a Hide on it, will be hidden for every row.

Example: Here's a view with a "Show Content" Conditional Formatting on the image, and "Apply Formatting" CondF on the 2nd column background.

Default view

All formatting hidden

All formatting visible

Interestingly, in the way we implemented the feature, "Set Visibility" options are actually saved into your page, which means that if you preview that page in the browser with a "Set Visibility" command like "All formatting hidden" set, you'll actually see the same thing in browser that FrontPage showed in design view. Arguably, a little weird :).