<?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>InfoPath 2010</title><link>https://www.infopathdev.com:443/forums/142.aspx</link><description>Are you exploring new features coming up in 2010? Share information and ask questions here!</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Deleting a full row in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/70842.aspx</link><pubDate>Tue, 04 Oct 2011 18:03:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70842</guid><dc:creator>Padraic</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70842.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=70842</wfw:commentRss><description>&lt;p&gt;Just to follow up on this and close this issue out.&lt;/p&gt;&lt;p&gt;I solved the problem thanks to an &lt;a href="http://msdn.microsoft.com/en-us/library/ff961895.aspx"&gt;MSDN article&lt;/a&gt; I found that was written by David Gerhardt. I had to amend his code sample slightly to get it to work with my scenario.&lt;/p&gt;&lt;p&gt;The code snippet that I finally used was as follows:&lt;/p&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;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;void&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; btnDelete_Clicked(&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; sender, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;ClickedEventArgs&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; e)&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;p&gt;        {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&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; selectedLegislation = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;//my:LegislationDetails&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNodeIterator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; legislationItems = selectedLegislation.Select(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;./my:LegislationRecord&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/p&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;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (legislationItems.Count &amp;gt; 0)&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for&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;int&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; i = legislationItems.Count; i &amp;gt; 0; i--)&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;/font&gt;&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; legislationItem = selectedLegislation.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:LegislationRecord[position() = &amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; + i + &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;, NamespaceManager);&lt;/font&gt;&lt;font size="2"&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;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/p&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;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (legislationItem.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:legislationselected&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;true&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;p&gt;                    {&lt;/p&gt;&lt;p&gt;                        legislationItem.DeleteSelf();&lt;/p&gt;&lt;p&gt;                    }&lt;/p&gt;&lt;p&gt;                }&lt;/p&gt;&lt;p&gt;            }&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Deleting a full row in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/70836.aspx</link><pubDate>Tue, 04 Oct 2011 16:47:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70836</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70836.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=70836</wfw:commentRss><description>No problem. There should be examples in this forum ove the last 7 years that show how to delete rows. You&amp;#39;ll need to write some code.</description></item><item><title>Re: Deleting a full row in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/70828.aspx</link><pubDate>Tue, 04 Oct 2011 08:39:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70828</guid><dc:creator>Padraic</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70828.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=70828</wfw:commentRss><description>&lt;p&gt;Thanks for the information Patrick.&lt;/p&gt;&lt;p&gt;&amp;nbsp;However, I would prefer to solve the problem without having to use third-party tools. &lt;/p&gt;&lt;p&gt;So, if anyone has any suggestions, I would be extremely grateful.&lt;/p&gt;</description></item><item><title>Re: Deleting a full row in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/70797.aspx</link><pubDate>Sun, 02 Oct 2011 22:06:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70797</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70797.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=70797</wfw:commentRss><description>qRules has a function called Delete and it&amp;#39;s documented in the User Guide. Free trial and it has 60+ other functions you can use.</description></item><item><title>Re: Deleting a full row in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/70795.aspx</link><pubDate>Sun, 02 Oct 2011 19:27:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70795</guid><dc:creator>Padraic</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70795.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=70795</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Really would appreciate some help with this issue!&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks,&lt;/p&gt;</description></item><item><title>Deleting a full row in a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/70709.aspx</link><pubDate>Thu, 29 Sep 2011 13:29:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70709</guid><dc:creator>Padraic</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70709.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=142&amp;PostID=70709</wfw:commentRss><description>Hi,

I would be grateful if someone could help me with some help on programmatically deleting a full row in a repeating table in InfoPath 2010.

I have 3 fields in a repeating table as follows:

legislationselected (Checkbox)
legislationcategory (textbox)
legislationref (textbox)

I would like to be able to loop through the repeating table rows and determine if the legislationselected checkbox has been selected. If it has then I want to be able to delete
that entire row and only that row.

I have tried coding it but I only had success with unchecking the legislation checkbox, which is not what I require. The code snippet for Delete button on the InfoPath 2010 form is as follows:

        public void btnDelete_Clicked(object sender, ClickedEventArgs e)
        {
            const string f1 = &amp;quot;/my:Referral/my:LegislationDetails/my:LegislationRecord/my:legislationselected&amp;quot;;
            XPathNavigator root = MainDataSource.CreateNavigator();
            XPathNavigator selectedLegislation = MainDataSource.CreateNavigator().SelectSingleNode(&amp;quot;//my:LegislationDetails&amp;quot;, NamespaceManager);
            XPathNodeIterator legislationItems = selectedLegislation.Select(f1, NamespaceManager);
            
            foreach (XPathNavigator legislationItem in legislationItems)
            {
                string msg = legislationItem.Value;
                   
                    if (msg == &amp;quot;true&amp;quot;)
                    {
                        legislationItem.DeleteSelf();
                    }            
            }

        }    

I would be extremely grateful for any help you can provide on this matter.

Thanks,

Padraic</description></item></channel></rss>