<?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>Controls</title><link>https://www.infopathdev.com:443/forums/43.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Prevent deleting of first row of repeating table</title><link>https://www.infopathdev.com:443/forums/thread/43242.aspx</link><pubDate>Sat, 20 Jun 2009 05:13:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43242</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43242.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=43242</wfw:commentRss><description>Hi, 
&lt;p&gt;We can prevent the user to delete the row when there is only one row using the on before change event. Once follow the below code (This is in C#).&lt;/p&gt;
&lt;p&gt;[InfoPathEventHandler(MatchPath = &amp;quot; /my:myFields/my:group1/my:group2&amp;quot;, EventType = InfoPathEventType.OnBeforeChange)]&lt;/p&gt;
&lt;p&gt;public void group2_OnBeforeChange(DataDOMEvent e)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;if (e.Operation != &amp;quot;Insert&amp;quot; &amp;amp;&amp;amp; thisXDocument.Dom.SelectNodes(&amp;quot;/my:myFields/my:group1/my:group2&amp;quot;).length == 0)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;e.ReturnMessage = &amp;quot;Cannot delete the row.&amp;quot;;&lt;/p&gt;
&lt;p&gt;e.ReturnStatus = false;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Prevent deleting of first row of repeating table</title><link>https://www.infopathdev.com:443/forums/thread/43220.aspx</link><pubDate>Fri, 19 Jun 2009 18:13:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43220</guid><dc:creator>vivasuzi</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43220.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=43220</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m hoping there&amp;#39;s an easy answer to this.&amp;nbsp; Is there anyway to prevent users from deleting the first row of the repeating table?&amp;nbsp; We want them to always have at least one row filled in but be able to add/delete additional rows if needed.&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t make the first row required because they are allowed to save as &amp;quot;draft&amp;quot; so making it required defeats the purpose of the draft.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Any ideas?&amp;nbsp; Hopefully it wouldn&amp;#39;t happen often but I worry someone would accidently delete all the rows of the table and then submit a Purchase Req with no items. I did remove the option for &amp;quot;remove all items&amp;quot; but can&amp;#39;t get rid of &amp;quot;remove one item&amp;quot; b/c then they won&amp;#39;t be able to remove any of them.&lt;/p&gt;
&lt;p&gt;Thanks for any ideas!&lt;/p&gt;</description></item></channel></rss>