hide or show a section or a control

K

Kenneth

Here is an example of what I want:

A form with a drop-down and a couple of sections. There are tables and/or
controls inside sections.

1. I do not want to show the sections when the form opens. I do this by
check "Do not include this section in the form by default" in section
properties dialog box.

2. I want to show a section when selection in the drop-down changes. Tried
to use "section properties"-->"Display"-->"conditional formating", but not
work. As there is only "Hide this control" check box, there is no "show this
control".

Searched and found a post by Scott, but XDocument.View.ExecuteAction does
not work.

Is this doable or not? Do we have a oControl.show() or oControl.visible =
true?

I searched InfoPath SDK but can not find it.

Thanks for any tip and trick.
 
K

Kenneth

Hi Anton,

Thanks for your post. What I want is to hide the section first and display
it after a selection of a drop-down changed.

Ken
 
K

Kenneth

I figured out this by myself.

1. To make a section hide at open, check "Do not include this section in the
form by default" in section properties dialog box.

2. To make a section show when a selection is changed. The section should be
an optional one. Then you need to check "Allow user to insert this section".

3. In OnAfterChange event handler, add this statement:
XDocument.View.ExecuteAction ("xOptional::insert", "xmlToEdit string");

The "xmlToEdit string" can be found in Advanced pane of section property.
 

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