<?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>Success!  I think....</title><link>https://www.infopathdev.com:443/forums/thread/45190.aspx</link><pubDate>Thu, 30 Jul 2009 14:17:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:45190</guid><dc:creator>Indyshawn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/45190.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=45190</wfw:commentRss><description>&lt;p&gt;So I think I&amp;#39;ve got this working now after reviewing a few more posts and doing some trial &amp;amp; error code updates.&amp;nbsp; I&amp;#39;ve come to the following code/conclusion (code-clusion?):&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;&lt;span style="FONT-SIZE:8pt;COLOR:teal;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;XPathNavigator&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt; Group = e.Source.SelectSingleNode(&lt;span style="COLOR:maroon;"&gt;&amp;quot;my:TFLgroup&amp;quot;&lt;/span&gt;, NamespaceManager) ;&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;COLOR:teal;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;XPathNavigator&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt; table = Group.SelectSingleNode(&lt;span style="COLOR:maroon;"&gt;&amp;quot;my:assocTFLs&amp;quot;&lt;/span&gt;, NamespaceManager);&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;Group.AppendChild(table);&amp;nbsp;&amp;nbsp; &lt;em&gt;&lt;strong&gt;&amp;lt;-- Appends a copy of the first row&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;COLOR:teal;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;XPathNavigator&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt; last = Group.SelectSingleNode(&lt;span style="COLOR:maroon;"&gt;&amp;quot;child::*[position() = last()]&amp;quot;&lt;/span&gt;,NamespaceManager);&amp;nbsp;&amp;nbsp; &lt;em&gt;&lt;strong&gt;&amp;lt;-- Reference to the last row&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:8pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;last.SelectSingleNode(&lt;span style="COLOR:maroon;"&gt;&amp;quot;my:TFLname&amp;quot;&lt;/span&gt;, NamespaceManager).SetValue(&lt;span style="COLOR:maroon;"&gt;&amp;quot;New last row value&amp;quot;&lt;/span&gt;);&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;em&gt;&amp;lt;-- Update value of field in the last row&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt; 
&lt;p&gt;&lt;font size="2"&gt;Even though it&amp;#39;s working, I&amp;#39;d be interested in comments re: alternate approaches.&amp;nbsp; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;Thanks!&lt;/font&gt;&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Appending row to repeating table via code</title><link>https://www.infopathdev.com:443/forums/thread/45186.aspx</link><pubDate>Thu, 30 Jul 2009 12:57:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:45186</guid><dc:creator>Indyshawn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/45186.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=45186</wfw:commentRss><description>&lt;p&gt;Thanks for referring to the previous post - that&amp;#39;s exactly the same issue I&amp;#39;m having.&amp;nbsp; However, I&amp;#39;m not quite understanding the solution that was recommended in the post-reply.&amp;nbsp; Specifically, the first step - if a node hasn&amp;#39;t been copied/cloned, how can it be appended?&amp;nbsp; I think there&amp;#39;s something being implied that I&amp;#39;m not picking up.&lt;/p&gt;</description></item><item><title>Re: Appending row to repeating table via code</title><link>https://www.infopathdev.com:443/forums/thread/45180.aspx</link><pubDate>Thu, 30 Jul 2009 07:10:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:45180</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/45180.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=45180</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Most likely the issue is that the Clone() method does not actually clone a node.&amp;nbsp; It just clones the XPath navigator.&amp;nbsp; Please check out this post:&lt;/p&gt;&lt;p&gt;http://www.infopathdev.com/forums/p/11440/40502.aspx#40502 &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Appending row to repeating table via code</title><link>https://www.infopathdev.com:443/forums/thread/45178.aspx</link><pubDate>Thu, 30 Jul 2009 02:56:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:45178</guid><dc:creator>Indyshawn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/45178.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=45178</wfw:commentRss><description>&lt;p&gt;I have a nested repeating table that I&amp;#39;m attempting to append rows to via C#. I&amp;#39;m very close to having it working properly, however, the issue I&amp;#39;m trying to resolve is: Each time a new row is appended to the nested repeating table, the new row has the correct values in its field, but the field of the first row is also changed to the same new value. The code uses the Clone() function to duplicate the first node and then attempts to reset the field value of that new node. However, when stepping through the code, I found that the field in the first row of the nested table is being reset as well. I&amp;#39;m on a different PC at the moment, so I can paste the exact code I&amp;#39;m using in a follow up. I just wanted to get this post created as my first action since joining the site tonight. Thanks for any input!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;- -&amp;nbsp;Update - -&lt;/strong&gt; &lt;em&gt;Code snippet with my understanding of each step (thanks for clarifications if my understanding is incorrect!)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Group = e.Source.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;my:TFLgroup&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager) ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;em&gt; &lt;font color="red"&gt;&amp;lt;--&amp;nbsp; Parent group of the repeating group&lt;/font&gt;&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/p&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; table = Group.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;my:assocTFLs&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&amp;nbsp;&amp;nbsp;&lt;em&gt; &lt;font color="red"&gt;&amp;lt;-- Repeating group&lt;/font&gt;&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; newRow = table.Clone();&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;em&gt;&lt;font color="red"&gt;&amp;lt;-- Cloning first row of repeating group&lt;/font&gt;&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;newRow.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;my:TFLname&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(_temp);&amp;nbsp; &lt;em&gt;&lt;font color="red"&gt;&amp;lt;--- Value update step; this also changes value of original first row&lt;/font&gt;&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;Group.AppendChild(newRow);&amp;nbsp;&amp;nbsp; &lt;em&gt;&lt;font color="red"&gt;&amp;lt;-- Appending new row to end of repeating group&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>