Programatically add or remove (x) number of rows based on value of a field in infopath 2007.

R

rayl81172

Hello,
I am new to Infopath 2007 and I am trying to find a way using code to
add or remove a certain number of rows from a repeating table based on
another fields value. Example: If Field1 value = 6, then add "six" new
rows to the table. If Field1 value changes to a new number, reset or
delete "just" the newly added 6 rows, and re-add "x" number rows based
on the "New" Field1 value. I have already tried using conditional
formatting and adding several default rows and then "Hide Rows" based
on this value, but the forms perofrmance suffers greatly. Any help
would be appreciated. Thanks in advance.
 
S

S.Y.M. Wong-A-Ton

P

Paresh

I recently published an article on how to programmatically add a row to a
repeating table (seehttp://enterprise-solutions.swits.net/infopath2007/programmatically-a...).
This is just one of several ways to do it. You can use the DeleteSelf() or
DeleteRange() methods of the XPathNavigator class to delete rows. Take a look
at this great article by Mark Roberts:http://msdn2.microsoft.com/en-us/library/bb509311.aspx. It should get you
started.
---
S.Y.M. Wong-A-Ton





- Show quoted text -

Hi,

Thanks for the valuable information. I tried creating a an Infopath
form using "blank" template and it works fine.
Then, I created a browser based IP form, using "Receive and Submit"
template for web services., added a repeating table that is binded to
my datasource and then I tried to add rows programmatically. But this
is not giving the desired result.

Is there anything that I am missing?

Thanks,
Paresh
 
S

S.Y.M. Wong-A-Ton

It is not clear to me what you're trying to do. You bound your main data
source to a web service and now want to add rows to a repeating table to do
what? What do you define as your desired result? Are you getting any errors?
 

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