<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: repeating table add rows programaticly</title><link>https://www.infopathdev.com:443/forums/thread/107404.aspx</link><pubDate>Tue, 19 Jul 2016 12:32:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:107404</guid><dc:creator>mloftus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/107404.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=107404</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;How would I programmatically add rows to a nested repeating tabled based on a drop down selection?&lt;/p&gt;&lt;p&gt;I have a repeating section with a drop down, button, a repeating&amp;nbsp;table&amp;nbsp;and a hidden field that calculates how many rows to add to the table based on an external data source.&amp;nbsp;I used the below code to add the correct amount of rows but when I add a new section and try to add rows it adds the same amount as it did in the first section.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim xpath As String = &amp;quot;/my:myFields/my:AdminTool/my:AToolCount&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim field As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode(xpath, NamespaceManager)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim rows As Integer = field.ValueAsInt&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim i As Integer&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 1 To rows - 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CurrentView.ExecuteAction(ActionType.XCollectionInsert, &amp;quot;Tool_31&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next i&lt;/p&gt;&lt;p&gt;Any help&amp;nbsp;would be much appreciated.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: repeating table add rows programaticly</title><link>https://www.infopathdev.com:443/forums/thread/71891.aspx</link><pubDate>Wed, 09 Nov 2011 14:52:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71891</guid><dc:creator>Brokholm</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71891.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=71891</wfw:commentRss><description>&lt;p&gt;Hi Hilary&lt;/p&gt;
&lt;p&gt;I was trying to get this to work, and after making a smaller change, I got it to work. As I always need to add 1 row to the table when the button is pressed, I have made the text box read only and set the value to 2.&lt;/p&gt;
&lt;p&gt;My code looks like this:&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; CTRL6_5_Clicked(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sender &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Object&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; e &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; ClickedEventArgs)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; xpath &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:field1&amp;quot;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; field &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode(xpath, NamespaceManager)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;xpath = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:group1/my:group2&amp;quot;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; group &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode(xpath, NamespaceManager)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; rows &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Integer&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; = field.ValueAsInt&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; i &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Integer&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;For&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; i = 1 &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;To&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; rows - 1&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; newRow &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XPathNavigator = group.Clone()&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;newRow.InsertAfter(group)&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Next&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; i&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;I would like to use this in a form we use for reviews. In each row in the table I have a text box which just shows which review we are at and a drop-down box which shows the result of the review, basically OK/ Not OK. I have been trying to add a condition to the&amp;nbsp;code to ensure that a new row is only inserted when the result of the review is &amp;quot;Not OK&amp;quot;. Unfortunately my programming skills are very rusty and I can&amp;#39;t get it to work.&lt;/p&gt;
&lt;p&gt;Do you have any ideas to how this should be added to the code?&lt;/p&gt;</description></item><item><title>Re: repeating table add rows programaticly</title><link>https://www.infopathdev.com:443/forums/thread/53538.aspx</link><pubDate>Fri, 09 Apr 2010 17:05:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53538</guid><dc:creator>ofergal</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53538.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=53538</wfw:commentRss><description>&lt;p&gt;What do You do if you want the table to start with no items and add few at once?&lt;/p&gt;</description></item><item><title>Re: repeating table add rows programaticly</title><link>https://www.infopathdev.com:443/forums/thread/38434.aspx</link><pubDate>Sat, 14 Feb 2009 16:15:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38434</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38434.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38434</wfw:commentRss><description>&lt;p&gt;Hiya Ben,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I&amp;#39;ve always held that &lt;a class="" title="ExecuteAction" href="http://www.infopathdev.com/forums/p/10344/37055.aspx#37055"&gt;ExecuteAction&lt;/a&gt; is a better way to insert new items into repeating groups, as it does not require cloning a node (a node can&amp;#39;t be cloned if there isn&amp;#39;t one there to begin with), and takes the guesswork out of putting the node together manually.&lt;/p&gt;
&lt;p&gt;The main problem with your code is that you seem to be using C# 2007 code but it looks like your form is set up to use JScript.&lt;/p&gt;
&lt;p&gt;Your screenshot is not showing up as its address seems to be located on your intranet and is not accessible to us:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blemain-intranet/sites/Intranet/accountsforms/test1/Picture10.png"&gt;http://blemain-intranet/sites/Intranet/accountsforms/test1/Picture10.png&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you put the picture up on the internet where we all can see it, I can show you some code that would probably do what you want.&lt;/p&gt;
&lt;p&gt;Jimmy&lt;/p&gt;</description></item><item><title>Re: repeating table add rows programaticly</title><link>https://www.infopathdev.com:443/forums/thread/38417.aspx</link><pubDate>Fri, 13 Feb 2009 20:07:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38417</guid><dc:creator>hiszorn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38417.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38417</wfw:commentRss><description>&lt;p&gt;Hello Ben,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Here is a sample that we modifed&amp;nbsp;that Hilary posted on another post.&amp;nbsp; We needed to add a row to the table we are in when the user clicks a button on the row.&amp;nbsp; This method copies the row clicked and adds it back into the table.&amp;nbsp; We use the sample xml file as a sort of template for adding rows.&amp;nbsp; I think you should be able to modify to suit your needs.&amp;nbsp; This sample works well for adding a new row to the table.&amp;nbsp; The issue with using&amp;nbsp;the clone method is you still point to the old row you cloned.&amp;nbsp; ProjectTask is a line in the group ProjectTaskList.&lt;/p&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;
&lt;p&gt;//Create a copy of current row and insert after current row&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XmlDocument&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sampleData = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XmlDocument&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;sampleData.Load(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Template.OpenFileFromPackage(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;sampledata.xml&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;));&lt;/p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; newProjectTask = sampleData.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:ProjectTicket/my:ProjectTaskList/my:ProjectTask&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Clone();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; OldGuid = e.Source.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:ProjectTaskId&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value;&lt;/p&gt;newProjectTask.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:DepartmentAbbrev&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(e.Source.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:DepartmentAbbrev&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;newProjectTask.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:Department&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(e.Source.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:Department&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value);&lt;/p&gt;newProjectTask.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:ParentTaskId&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(OldGuid);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;newProjectTask.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:IncludedInChangeRequest&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;True&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/p&gt;newProjectTask.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:ProjectTaskId&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Guid&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.NewGuid().ToString());&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;newProjectTask.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:ChangeOrderLineNumber&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(GetField(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:ProjectTicket/my:ChangeOrderNumber&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;));&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; TaskName = e.Source.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:TaskName&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value + &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;-&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; + GetField(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:ProjectTicket/my:ChangeOrderNumber&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;newProjectTask.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:TaskName&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(TaskName);&lt;/p&gt;
&lt;p&gt;e.Source.InsertAfter(newProjectTask);&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: repeating table add rows programaticly</title><link>https://www.infopathdev.com:443/forums/thread/38405.aspx</link><pubDate>Fri, 13 Feb 2009 15:10:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38405</guid><dc:creator>Anonymous</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38405.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38405</wfw:commentRss><description>&lt;p&gt;Hi Hilary, hoping you can shine some light on this problem for me as I&amp;#39;ve spent hours searching the forums and am still not having any luck with this!&amp;nbsp; I have a relatively simple form for tracking overtime worked/paid - the user fills in the info (date, start time, end time) into a repeating table which then calculates &amp;quot;hours worked&amp;quot; and the&amp;nbsp;&amp;quot;hours earned&amp;quot;.&amp;nbsp; What I&amp;#39;d like is for the user to then click a button if they want the overtime to be paid, and have the &amp;quot;date&amp;quot; and &amp;quot;hours earned&amp;quot; automatically populate into a second repeating table.&amp;nbsp; This would need to be repeated for each instance of overtime, and a new row inserted into the secondary repeating table each time.&lt;/p&gt;
&lt;p&gt;Right now my data source looks like this:&lt;/p&gt;
&lt;p&gt;&lt;img style="WIDTH:199px;HEIGHT:401px;" height="726" src="http://blemain-intranet/sites/Intranet/accountsforms/test1/Picture10.png" width="377" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried using the below code which I&amp;#39;ve kind of made up from what I could find on here but I can&amp;#39;t even get the form to open in preview with it so I&amp;#39;ve obviously done something wrong!&amp;nbsp; Any help is greatly appreciated.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Ben&lt;/p&gt;
&lt;p&gt;function CTRL89_7::OnClick(eventObj) &lt;/p&gt;
&lt;p&gt;&amp;nbsp;{ &lt;/p&gt;
&lt;p&gt;XPathNavigator group = MainDataSource.CreateNavigator().SelectSingleNode &lt;/p&gt;
&lt;p&gt;(&amp;quot;/my:OvertimeTracking/my:Payments/my:PaymentDetails[last()]&amp;quot;, NamespaceManager);&lt;/p&gt;
&lt;p&gt;XPathNavigator NewRow = group.Clone(); NewRow.InsertAfter(group); &lt;/p&gt;
&lt;p&gt;//Set each field value NewRow.SelectSingleNode&lt;/p&gt;
&lt;p&gt;(&amp;quot;my:DateWorked&amp;quot;, NamespaceManager).SetValue(&amp;quot;my:Date&amp;quot;); NewRow.SelectSingleNode(&amp;quot;my:HoursToBePaid&amp;quot;, NamespaceManager).SetValue(&amp;quot;my:HoursEarned&amp;quot;); }&lt;/p&gt;</description></item><item><title>Re: repeating table add rows programaticly</title><link>https://www.infopathdev.com:443/forums/thread/34121.aspx</link><pubDate>Tue, 11 Nov 2008 16:44:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34121</guid><dc:creator>hiszorn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34121.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34121</wfw:commentRss><description>&lt;p&gt;I finally figured this out.&amp;nbsp; The issue is setting the values before inserting the new row.&amp;nbsp; It seems like when you do that, InfoPath keeps a pointer to the other row.&amp;nbsp; So once I inserted first and then set values, it works fine:&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; group = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:ProjectTicket/my:BudgetMaster/my:BudgetLine[last()]&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; NewRow = group.Clone();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;NewRow.InsertBefore(group);&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//Set each field value&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;NewRow.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:LineStatus&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;test&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;NewRow.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:Dept&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;IT&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/p&gt;
&lt;p&gt;NewRow.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:CostQuantity&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;2&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Thank you for all the help!&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Jeff&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: repeating table add rows programaticly</title><link>https://www.infopathdev.com:443/forums/thread/34116.aspx</link><pubDate>Tue, 11 Nov 2008 15:39:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34116</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34116.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34116</wfw:commentRss><description>&lt;p&gt;Do you have a default value set on the field &amp;#39;my:LineStatus&amp;#39;? Or a rule hanging about somewhere that might be doing that? Becuase in the code, you are creating a new group called NewRow and setting the value only on that field in that group.....&lt;/p&gt;
&lt;p&gt;By the way, the XPath you were using at first was taking the first Budget Line group and cloning it -- now you are cloning the last one. I suggested using &amp;#39;last&amp;#39; if you changed to using Jimmy&amp;#39;s method of using:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;CurrentView.ExecuteAction(&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;ActionType&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.XCollectionInsert, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;XmlToEdit&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Either is fine -- just wanted you to be aware of what the difference was.&lt;/p&gt;</description></item><item><title>Re: repeating table add rows programaticly</title><link>https://www.infopathdev.com:443/forums/thread/34112.aspx</link><pubDate>Tue, 11 Nov 2008 15:00:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34112</guid><dc:creator>hiszorn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34112.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34112</wfw:commentRss><description>&lt;p&gt;Hi Hilary,&lt;/p&gt;
&lt;p&gt;I did not have the [Last()] in my XPath so I added that.&amp;nbsp; The issue I am still seeing is that when I set the value, it sets &lt;em&gt;all&lt;/em&gt; the rows values to the new value, not just the new row:&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; group = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:ProjectTicket/my:BudgetMaster/my:BudgetLine[last()]&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; NewRow = group.Clone();&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//Set each field value&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;NewRow.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:LineStatus&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;test&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;NewRow.InsertAfter(group);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Jeff&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: repeating table add rows programaticly</title><link>https://www.infopathdev.com:443/forums/thread/34084.aspx</link><pubDate>Tue, 11 Nov 2008 06:11:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34084</guid><dc:creator>chandrakanth</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34084.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34084</wfw:commentRss><description>&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Hi,&lt;/font&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;“PATH OF THE FOLDER INSIDE REPEATING TABLE FOLDER” means the row (group) inside the repeating table where you want to insert new row (group) before that. (Ex: MainDataSource.CreateNavigator ().SelectSingleNode(“/my:myFields/my:group1/my:group2[my:field1= “Some Value”]”).&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Please follow the below code lines for adding a row inside a repeating table.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;IXMLDOMNode startNode; // Position of the already existing node (row) inside a repeating table.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;IXMLDOMNode newNode; // New node which you want to add inside a repeating table.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;AddWhere&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;where;// the position of the row.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;if(where == AddWhere.&lt;b style="mso-bidi-font-weight:normal;"&gt;First&lt;/b&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;startNode.insertBefore(newNode, GetNode(startNode, &amp;quot;child::node()&amp;quot;));&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;else if(where == AddWhere.&lt;b style="mso-bidi-font-weight:normal;"&gt;Before&lt;/b&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;startNode.parentNode.insertBefore(newNode, startNode);&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;else if(where == AddWhere.&lt;b style="mso-bidi-font-weight:normal;"&gt;After&lt;/b&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;startNode.parentNode.insertBefore(newNode, GetNode(startNode, &amp;quot;following-sibling::node()&amp;quot;));&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;else if(where == AddWhere.&lt;b style="mso-bidi-font-weight:normal;"&gt;Last&lt;/b&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count:1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;startNode.appendChild(newNode);&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: repeating table add rows programaticly</title><link>https://www.infopathdev.com:443/forums/thread/34076.aspx</link><pubDate>Tue, 11 Nov 2008 01:31:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34076</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34076.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34076</wfw:commentRss><description>&lt;p&gt;Hi, Jeff:&lt;/p&gt;
&lt;p&gt;If you follow Jimmy&amp;#39;s suggestion, the node you will want to set the values on will be the last node in your repeating group. So you could create an XPathNavigator variable to the last node, like this:&lt;/p&gt;
&lt;p&gt;XPathNavigator&lt;font color="#333333" size="2"&gt; group = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:ProjectTicket/my:BudgetMaster/my:BudgetLine[last()]&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font color="#333333" size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Then you could set the values by selecting single nodes from the group:&lt;/p&gt;
&lt;p&gt;group.SelectSingleNode(&lt;font color="#a31515"&gt;&amp;quot;my:fieldInBudgetLineGroup&amp;quot;&lt;/font&gt;).SetValue(&lt;font color="#a31515"&gt;&amp;quot;A Value&amp;quot;&lt;/font&gt;);&lt;/p&gt;
&lt;p&gt;If you want to use the code you are currently using, where you clone nodes, you can set the values on the nodes in the variable NewRow before inserting;&lt;/p&gt;
&lt;p&gt;NewRow.SelectSingleNode(&lt;font color="#a31515"&gt;&amp;quot;my:fieldInBudgetLineGroup&amp;quot;&lt;/font&gt;).SetValue(&lt;font color="#a31515"&gt;&amp;quot;A Value&amp;quot;&lt;/font&gt;);&lt;/p&gt;
&lt;p&gt;Does that make sense?&lt;/p&gt;</description></item><item><title>Re: repeating table add rows programaticly</title><link>https://www.infopathdev.com:443/forums/thread/34074.aspx</link><pubDate>Tue, 11 Nov 2008 00:21:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34074</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34074.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34074</wfw:commentRss><description>&lt;p&gt;Have you tried:&lt;/p&gt;
&lt;blockquote&gt;&lt;font size="2"&gt;
&lt;p&gt;CurrentView.ExecuteAction(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;ActionType&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.XCollectionInsert, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;XmlToEdit&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;where &lt;font color="#a31515"&gt;XmlToEdit&lt;/font&gt;&lt;font color="#000000"&gt; is a unique identifier for the repeating table that you can find in the InfoPath designer?&amp;nbsp; This mimics the behavior that InfoPath carries out when a user adds a row to a repeating table/section and takes all the guesswork out of adding rows to repeating tables/sections.&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: repeating table add rows programaticly</title><link>https://www.infopathdev.com:443/forums/thread/34073.aspx</link><pubDate>Mon, 10 Nov 2008 23:39:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34073</guid><dc:creator>hiszorn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34073.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=34073</wfw:commentRss><description>&lt;p&gt;Hi Hilary,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I am using the clone method to copymy repeating table row and then insert it into the table.&amp;nbsp;&amp;nbsp; I was wondering what the proper way to set a value of the fields prior to the insert after call.&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; group = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:ProjectTicket/my:BudgetMaster/my:BudgetLine&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; NewRow = group.Clone();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//Set each field value prior to inserting, ie i Have a field called LineStatus the is in BudgetLine that I would like to set a value for.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;NewRow.InsertAfter(group);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Thanks,&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Jeff&lt;/font&gt;&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: repeating table add rows programatically</title><link>https://www.infopathdev.com:443/forums/thread/31936.aspx</link><pubDate>Wed, 03 Sep 2008 17:58:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31936</guid><dc:creator>Patrick</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31936.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=31936</wfw:commentRss><description>&lt;p&gt;Ok that&amp;#39;s what I figured.&amp;nbsp; I tried the AppendChild() method and it worked, but the performance was worse :(&amp;nbsp; It was worth a try though.&amp;nbsp; Adding 5 rows took 2.5 times longer than the cloning method. &amp;nbsp;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: repeating table add rows programatically</title><link>https://www.infopathdev.com:443/forums/thread/31933.aspx</link><pubDate>Wed, 03 Sep 2008 17:48:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31933</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31933.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=31933</wfw:commentRss><description>&lt;p&gt;Yah, I used the if statement so that if this was on the changed event of a field I wouldn&amp;#39;t end up in an infinite loop.&lt;/p&gt;</description></item></channel></rss>