Update Repeating Control via VS 2005 formControl

E

esebastian

Hello All,
I have created a project half in infopath and half in visual studio c#
windows code. My VS app calls the infopath form, the form is filled
out and then the xml is saved to our datbase. I have a certain button
that when clicked opens another windows form does some stuff and then
returns a dictionary of information to the main window where i want to
take that information and insert it into a repeating control that i
have in my form. I can't seem to do this however. Here are the
details.

I have created a repeating group in my infopath datasource it looks
like this:

<Images> -- repeating group
<Image type='' id=''></Image>
</Images>

there could be many of these <Image type='' id=''></Image> rows and
this is where i need help becuase i need to populate these rows from
the visual studio project. I have been trying to use executeAction on
the current view but i keep getting errors... here is the line of code
i am using.

formControl1.XmlForm.CurrentView.ExecuteAction(Microsoft.Office.InfoPath.ActionType.XCollectionInsert,
"Images_77");

I just happened to open the manifest file and noticed that these
fields are not inside the manifest even though i did drop them on the
form as optional controls that are not visible.

Can someone PLEASE HELP, i have spent days on this and am getting
nowhere!!!!!

Thanks,
Erin
 
E

esebastian

Hi Everyone,
I ended up having to call Microsoft on this one. The repeating table I
had was inside an optional section on my form. It turns out you cannot
add nodes programmatically to optional sections, i turned my option
section into a regular section and all works as it should.
Erin
 

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