<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Copy LAST row of repeating table?</title><link>https://www.infopathdev.com:443/forums/thread/70420.aspx</link><pubDate>Mon, 19 Sep 2011 16:01:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70420</guid><dc:creator>jaxkookie</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70420.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=70420</wfw:commentRss><description>I was looking for a similar solution for 2010, with nested repeating tables. I tried both solutions and this one was a homerun. thanks</description></item><item><title>Re: Copy LAST row of repeating table?</title><link>https://www.infopathdev.com:443/forums/thread/51652.aspx</link><pubDate>Wed, 10 Feb 2010 20:27:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:51652</guid><dc:creator>kcoakley</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/51652.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=51652</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Jimmy - thanks again for your help. Your IP 2007 code worked like a charm as soon as I realized that my repeating table must be the last node in my &amp;quot;parent&amp;quot; node.&lt;/p&gt;&lt;p&gt;Thanks again,&lt;br /&gt;Ken&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Copy LAST row of repeating table?</title><link>https://www.infopathdev.com:443/forums/thread/51592.aspx</link><pubDate>Wed, 10 Feb 2010 02:05:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:51592</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/51592.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=51592</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;kcoakley:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;What are the offending items in this code?&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Every single one of them, I&amp;#39;m afraid :-)&lt;/p&gt;&lt;p&gt;&amp;nbsp;The corresponding code for IP 2007 would be:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;font color="#2b91af"&gt;&lt;font size="2"&gt;XPathNavigator &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;row = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;//my:repeatingtable[last()]&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;// I don&amp;#39;t think you need the value getting and setting code,&lt;br /&gt;// since the values are already in the row being copied&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;&lt;br /&gt;&lt;br /&gt;XPathNavigator &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;parent = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:myFields&amp;quot;&lt;/font&gt;&lt;/font&gt;, NamespaceManager);&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;parent.AppendChild(row);&lt;/p&gt;&lt;/font&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Re: Copy LAST row of repeating table?</title><link>https://www.infopathdev.com:443/forums/thread/51586.aspx</link><pubDate>Tue, 09 Feb 2010 22:18:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:51586</guid><dc:creator>kcoakley</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/51586.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=51586</wfw:commentRss><description>&lt;p&gt;Thank you both for your replies - I really appreciate it! Jimmy&amp;#39;s suggestion worked perfectly and now the button is behaving exactly as I had hoped.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;One last question, if I might... I&amp;#39;m using InfoPath 2007 but this code requires C# with InfoPath 2003 compatibility to run correctly. What are the offending items in this code?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks again,&lt;br /&gt;Ken&lt;/p&gt;</description></item><item><title>Re: Copy LAST row of repeating table?</title><link>https://www.infopathdev.com:443/forums/thread/51533.aspx</link><pubDate>Tue, 09 Feb 2010 05:01:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:51533</guid><dc:creator>Qazi Anis</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/51533.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=51533</wfw:commentRss><description>&lt;p&gt;try this&amp;nbsp;&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; XPathNodeIterator listItemNav = this.MainDataSource.CreateNavigator().Select(&amp;quot;my:myFields/my:group1/my:group2&amp;quot;, this.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; for (int i = 0; i &amp;lt; listItemNav.Count; i++, listItemNav.MoveNext()) ;&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; listItemNav.Current.Clone().InsertAfter(listItemNav.Current);&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Copy LAST row of repeating table?</title><link>https://www.infopathdev.com:443/forums/thread/51531.aspx</link><pubDate>Tue, 09 Feb 2010 02:42:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:51531</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/51531.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=51531</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;What happens if you use &amp;quot;//my:repeatingtable[last()]&amp;quot; in that first line?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Copy LAST row of repeating table?</title><link>https://www.infopathdev.com:443/forums/thread/51517.aspx</link><pubDate>Mon, 08 Feb 2010 17:47:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:51517</guid><dc:creator>kcoakley</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/51517.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=51517</wfw:commentRss><description>&lt;p&gt;Hello and thank you for such a wonderful resource!&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve cobbled together some code found here that copies the first row of a repeating table and appends it to the bottom of the repeating table when I click a button. The code looks like this:&lt;/p&gt;
&lt;p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;-----&lt;br /&gt;IXMLDOMNode&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; row = thisXDocument.DOM.selectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;//my:repeatingtable&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/p&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; field1 = row.selectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:field1&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).text;&lt;br /&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; field2 = row.selectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:field2&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).text;&lt;br /&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; field3 = row.selectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:field3&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).text;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font size="2"&gt;row = row.cloneNode(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font size="2"&gt;row.selectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:field1&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).text = field1;&lt;br /&gt;row.selectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:field2&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).text = field2;&lt;br /&gt;row.selectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:field3&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).text = field3;&lt;/p&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;IXMLDOMNode&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; parent = thisXDocument.DOM.selectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:myFields&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;parent.appendChild(row);&lt;br /&gt;-----&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Is there a simple way to modify this code so that the LAST row of the repeating table is copied?&lt;/p&gt;
&lt;p&gt;Thank you,&lt;br /&gt;Ken&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>