<?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: Sorting Nested Repeating Sections</title><link>https://www.infopathdev.com:443/forums/thread/87991.aspx</link><pubDate>Wed, 13 Mar 2013 21:09:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:87991</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/87991.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=87991</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Wonderful - sorry no one had any suggestions / help for you. I&amp;#39;m glad you got it sorted. Care to post your solution?&lt;/p&gt;</description></item><item><title>Re: Sorting Nested Repeating Sections</title><link>https://www.infopathdev.com:443/forums/thread/87990.aspx</link><pubDate>Wed, 13 Mar 2013 21:03:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:87990</guid><dc:creator>echotrain</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/87990.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=87990</wfw:commentRss><description>&lt;p&gt;This was eventually solved&lt;/p&gt;</description></item><item><title>Sorting Nested Repeating Sections</title><link>https://www.infopathdev.com:443/forums/thread/87505.aspx</link><pubDate>Wed, 27 Feb 2013 21:50:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:87505</guid><dc:creator>echotrain</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/87505.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=87505</wfw:commentRss><description>&lt;p&gt;I have a form with a repeating section which contains a repeating section of its own. I would like to sort the form based on&amp;nbsp;the field in the outer section, which worked until I&amp;nbsp;made the other controls part of&amp;nbsp;a&amp;nbsp;repeating subsection.&lt;/p&gt;&lt;p&gt;I uploaded&amp;nbsp;an image&amp;nbsp;of the nested sections to help visualize the data (below).&lt;/p&gt;&lt;p&gt;Here is the code that worked before adding the repeating&amp;nbsp;subsection:&lt;/p&gt;
&lt;pre&gt;        private void SortRepeatingTable(string fieldName)
        {
            XPathNavigator mainDS = MainDataSource.CreateNavigator();
            XPathNavigator aritems = mainDS.SelectSingleNode(
              &amp;quot;/my:myFields/my:ARItems&amp;quot;, NamespaceManager);
            XmlReader reader = aritems.ReadSubtree();

            DataSet ds = new DataSet();
            ds.ReadXml(reader);

            DataTable sortedTable = new DataTable();

            if (ds.Tables != null &amp;amp;&amp;amp; ds.Tables.Count &amp;gt; 0)
            {
                DataTable dt = ds.Tables[0];
                sortedTable = dt.Copy();
                sortedTable.Clear();

                DataRow[] rows = dt.Select(&amp;quot;&amp;quot;, fieldName + &amp;quot; ASC&amp;quot;);

                foreach (DataRow row in rows)
                {
                    sortedTable.Rows.Add(row.ItemArray);
                }
            }

            ds.Tables.Clear();
            ds.Tables.Add(sortedTable);

            using (MemoryStream ms = new MemoryStream())
            {
                ds.WriteXml(ms);

                ms.Position = 0;
                XPathDocument doc = new XPathDocument(ms);
                aritems.ReplaceSelf(doc.CreateNavigator());

                ms.Close();
            }
        }&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;Somehow I can&amp;#39;t make the leap to taking my nested section along when I move the outer containers around. I would appreciate any ideas on this.
&lt;/pre&gt;</description></item></channel></rss>