Nice to have: Conditional Formatting based on controls (expression boxes)

G

G. Tarazi

Hi



I have a larger form, full with expression boxes; the expression boxes have
conditional formatting, that shows them or hides them based on a specific
condition (each box is different).



Now, all of the boxes are aligned in the form using a table, it may happen
that the entire section (10 expression boxes in one row) to be hidden.



The problem is the row is still there but empty.



As a work around, I would use sections, the problem is, I am not able to
tell the section: hey, if all these expression boxes are empty, just hide,
instead, I must tell the section: hey, if all this conditional formatting of
all these expression boxes match at the same time, hide, otherwise show.



Just an idea.
 
G

G. Tarazi

Thanks for the help; I never know that the conditional formatting can be
done using externally in a function.




I will try it in my next form, this one already have multiple lines of
conditional formatting for 674 controls (by yesterday) and that’s just at
design time.



Thanks again





"Greg Collins [InfoPath MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in
message If its any help to you, I find that when conditions start becoming complex
it is easier to do them in code. The conditional formatting uses a single
"xdExtension:myConditionFunction()" which returns a boolean, and the code
does the rest.

It might take a few moments to get the initial conversion to code completed,
but I find this much easier to read and update for larger or more complex
conditions.

Then if you have a situation like your table in a section, you can call a
function, which test each of the other ten functions and returns to combined
boolean value.

Ultimately this is much easier to read, and also, if a condition on any of
the expression boxes ever changes, the section condition is automatically
updated as well.

Hope this helps!

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



"G. Tarazi" <Tarazi (at) Live Technologies .Ca> wrote in message
Hi



I have a larger form, full with expression boxes; the expression boxes have
conditional formatting, that shows them or hides them based on a specific
condition (each box is different).



Now, all of the boxes are aligned in the form using a table, it may happen
that the entire section (10 expression boxes in one row) to be hidden.



The problem is the row is still there but empty.



As a work around, I would use sections, the problem is, I am not able to
tell the section: hey, if all these expression boxes are empty, just hide,
instead, I must tell the section: hey, if all this conditional formatting of
all these expression boxes match at the same time, hide, otherwise show.



Just an idea.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top