InfoPath List Form Enhanced Text Showing All Grey and Stuff

Applies To: SharePoint 2010, InfoPath 2010

As mentioned in my previous post, you can replace the standard list item forms with InfoPath browser based forms (SharePoint 2010 Server Enterprise only). This is a great feature but there are some gotchas that can be hard to find answers to; mostly because these types of forms have different limitations and options than other InfoPath forms.

I was using this feature and had a form view for New, Edit & Display and everything was mostly working. However, my display view was annoying the crap out of me. My list has a couple of Multiple lines of text columns that allow Enhanced rich text (Rich text with pictures, tables, and hyperlinks). Although these displayed just fine on a standard List Item Display Form, they were Grayed out on my InfoPath List Item Display Form.

This means that although it would show formatting such as bold or underline, any text colors you picked were totally overridden with that obnoxious gray:

Turns out I had set the view to Read-only (This is the Display view so that seemed like an important step to me). In my desperation I opened up the View Properties and unchecked the Read-only box, hit OK and re-published the form.

When I opened the List Item Display view everything looked perfect. Apparently InfoPath and/or SharePoint is smart enough to know to make everything uneditable when displaying a list item:

InfoPath List Form New Item is Read Only

Applies To: SharePoint 2010, InfoPath 2010

Many of you are probably aware that you can replace the standard list item forms with InfoPath browser based forms (SharePoint 2010 Server Enterprise only), and if you weren’t, you are now. It’s as simple as hitting the Customize Form button on the List tab of the List Tools ribbon:

By default the same form is used for all three views (New, Edit, & Display). You can create new views in InfoPath (Page Design tab -> New View) and then back in SharePoint use the Form Web Parts dropdown shown above to customize the InfoPath Form Web Part to show the view you want. There are other guides out there to getting this done that go into more detail, but that’s the gist of it.

I ran into an interesting problem the other day when using this feature. I had a form view for New, Edit & Display and everything was working great. Then I realized that I had some optional fields that I didn’t want to show on the display form if they were blank.

So I wrapped those up in a section and slapped a formatting rule to “Hide this control”:

Boom! I published the form and everything displayed as expected. I did a bunch of other stuff and then went back to add another item to the list. Suddenly the form view I was using for the New List Item was completely Read-only. Obviously, that’s a problem.

I opened the form back up in InfoPath and made sure the View Properties didn’t have the Read-only checkbox checked – Nope. I cried a little but then through the blur of my tears I noticed that every field on every view that wasn’t in one of my auto hide sections had a little blue info icon. Hovering over the icon showed FieldName (Control bound to missing field or group). What a heck?

Meanwhile the Edit form is still working great. So I right-clicked on the fields choose Change Binding and verified they were all hooked up correctly. Some searching brought me to this TechNet thread. The answer is in there but it wasn’t super obvious to me.

Basically, by adding the sections I had caused all the other fields on all the views to be outside the SharePointListItems_RW section and this breaks their binding. So how do you fix it? It’s actually pretty simple.

Right-click on any of your Optional Sections and choose Section Properties from the context menu. In the Default settings section of the Data tab is a radio button. Switch it from Do not include the section in the form by default to Include the section in the form by default. Click OK.

Suddenly all the little blue info icons go away and every Optional Section is now called Section. Re-Publish your form and you’ll find the auto-hiding still works perfectly and your New Item form is no longer Read-only. See? It can’t rain all the time sunshine!