<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Problems with getting the row number (index) of the repeating table using e.Source.selectNodes("preceding-sibling::)</title><link>https://www.infopathdev.com:443/forums/thread/36968.aspx</link><pubDate>Mon, 12 Jan 2009 23:30:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36968</guid><dc:creator>dyungn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36968.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=36968</wfw:commentRss><description>&lt;font size="2"&gt;
&lt;p&gt;Thanks Shiva,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tried this with&amp;nbsp;e.Site.parentNode (as e.parentNode was not an option) and it works fine.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/font&gt;&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Problems with getting the row number (index) of the repeating table using e.Source.selectNodes("preceding-sibling::)</title><link>https://www.infopathdev.com:443/forums/thread/36931.aspx</link><pubDate>Mon, 12 Jan 2009 14:51:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36931</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36931.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=36931</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;dyungn:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;Can anybody help me here?&amp;nbsp; What is the difference entering OnAfterChange when inserting a new row as opposed to modifiying existing row.&lt;/font&gt; 
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;The difference is the position of e.Source.&amp;nbsp; You can surround the row number calculation in a conditional statement like this:&lt;/p&gt;
&lt;p&gt;if(e.Source.nodeName.Equals(&amp;quot;&lt;strong&gt;&lt;em&gt;name of the repeating node&lt;/em&gt;&lt;/strong&gt;&amp;quot;))&amp;nbsp; // e.g. e.Source.nodeName.Equals(&amp;quot;my:group2&amp;quot;)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i&lt;font size="2"&gt;nt rowNumber =&amp;nbsp;&amp;nbsp;e.Source.selectNodes(&amp;quot;preceding-sibling::my:LeaveEntry/my:startDate&amp;quot;).length + 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // the rest of your code&lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Re: Problems with getting the row number (index) of the repeating table using e.Source.selectNodes("preceding-sibling::)</title><link>https://www.infopathdev.com:443/forums/thread/36915.aspx</link><pubDate>Mon, 12 Jan 2009 06:38:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36915</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36915.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=36915</wfw:commentRss><description>&lt;p&gt;Hello Welcome to the Forums,&lt;/p&gt;
&lt;p&gt;onAfteChange, e.site is different from e.source node. If you want exact rowNumber count for new row and modifying the node means you have to use the below code,&lt;/p&gt;
&lt;p&gt;IXMLDOMNode parentNode = e.parentNode;&lt;/p&gt;
&lt;p&gt;int rowNumber =&amp;nbsp;&amp;nbsp;parentNode.selectNodes(&amp;quot;preceding-sibling::my:LeaveEntry/my:startDate&amp;quot;).length + 1;&lt;/p&gt;</description></item><item><title>Problems with getting the row number (index) of the repeating table using e.Source.selectNodes("preceding-sibling::)</title><link>https://www.infopathdev.com:443/forums/thread/36912.aspx</link><pubDate>Mon, 12 Jan 2009 02:41:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36912</guid><dc:creator>dyungn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36912.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=36912</wfw:commentRss><description>&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font size="2"&gt;Newbie here so go easy.&amp;nbsp; I am using Visual Studio 2003 and Infopath.&amp;nbsp; I&amp;nbsp;access the a repeating table via OnAfterChange of one of the fields.&amp;nbsp; When I insert a new row, I get the correct row number using&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;int rowNumber =&amp;nbsp;&amp;nbsp;e.Source.selectNodes(&amp;quot;preceding-sibling::my:LeaveEntry/my:startDate&amp;quot;).length + 1;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;but when I modify the&amp;nbsp;field in the existing&amp;nbsp;row,&amp;nbsp;rowNumber is aloway&amp;nbsp;1.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;Can anybody help me here?&amp;nbsp; What is the difference entering OnAfterChange when inserting a new row as opposed to modifiying existing row.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Dyung.&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>