<?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: Using Visual Basic/VSTO, identify currently selected row of master/detail repeating table</title><link>https://www.infopathdev.com:443/forums/thread/51671.aspx</link><pubDate>Thu, 11 Feb 2010 12:04:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:51671</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/51671.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=51671</wfw:commentRss><description>&lt;p&gt;You are using an absolute path here:&lt;/p&gt;&lt;p&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;/my:minaFlt/my:grupp1/my:grupp2&lt;/font&gt;&lt;/font&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;But you need to use a relative path (relative to e.Source) to get at the node you want.&amp;nbsp; Are you sure that e.Source isn&amp;#39;t &lt;i&gt;already&lt;/i&gt; positioned at the &lt;b&gt;grupp2&lt;/b&gt; node that you need?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Using Visual Basic/VSTO, identify currently selected row of master/detail repeating table</title><link>https://www.infopathdev.com:443/forums/thread/51669.aspx</link><pubDate>Thu, 11 Feb 2010 09:26:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:51669</guid><dc:creator>zoomzky</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/51669.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=51669</wfw:commentRss><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;I have a similar scenario and have tried multiple solutions found on the internet but all of them shows the same unwanted result.&lt;br /&gt;No matter what method i use the code returns the first row in the resulting table regardless the selected row. &lt;/p&gt;
&lt;p&gt;&lt;u&gt;My scenario&lt;br /&gt;&lt;/u&gt;I have created a form that connects to a SQL-server with both queryfields and datafields is presented in a repeating table.&lt;br /&gt;When a user selects a row in the table i want to trigger code that copys the selected rows value to other fields in the form.&lt;br /&gt;Im using IP 2007 to create the forms and have to save the finished form in IP 2003 since the intended clients only have IP 2003 installed.&lt;/p&gt;
&lt;p&gt;Found a couple of sample codes that are supposed to give me what i want but all of them returns the first row in queryresult&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Example where i have added a button in a column&lt;/u&gt;&lt;/strong&gt; &lt;/p&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;Sub&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; CTRL5_5_Clicked(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sender &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&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;Object&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;ByVal&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; e &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; ClickedEventArgs)&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&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;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; DOM &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XPathNavigator = e.Source.CreateNavigator()&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;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Row &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&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;String&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; = DOM.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:minaFlt/my:grupp1/my:grupp2&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;MessageBox.Show(Row)&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;End&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;Sub&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Almost driving me crazy....crossing fingers i can get some help :)&lt;br /&gt;I thought for a while i could use the current-function which i interpet to show the selected item in list of values but i havent found any examples using it.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Regards,&lt;br /&gt;/Micke L&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Using Visual Basic/VSTO, identify currently selected row of master/detail repeating table</title><link>https://www.infopathdev.com:443/forums/thread/47202.aspx</link><pubDate>Mon, 21 Sep 2009 14:08:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:47202</guid><dc:creator>GMLear</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/47202.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=47202</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Jimmy,&lt;/p&gt;&lt;p&gt;This is the solution I&amp;#39;ve been looking for.&amp;nbsp; Thanks.&amp;nbsp; I was stuck for days as to how to use the GetNamedNodeProperty method.&amp;nbsp; VB would give me a &amp;quot;Reference to a non-shared member requires an object reference.&amp;quot; error.&amp;nbsp; Your code shows how to make the proper declaration &lt;br /&gt;(&amp;quot;Me.MainDatasource.GetNamedNodeProperty&amp;quot;).&lt;/p&gt;&lt;p&gt;&amp;nbsp;And thanks to Hilary and everyone at Odabra who supports this forum.&amp;nbsp; What a great resource!&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Using Visual Basic/VSTO, identify currently selected row of master/detail repeating table</title><link>https://www.infopathdev.com:443/forums/thread/47162.aspx</link><pubDate>Sat, 19 Sep 2009 03:11:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:47162</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/47162.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=47162</wfw:commentRss><description>&lt;p&gt;If you&amp;#39;re using the 2007 VB object model, this is the general idea.&amp;nbsp; You&amp;#39;ll need to adjust the underlined parts to suit your solution.:&lt;/p&gt;&lt;font size="2"&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;#39; Retrieve a reference to the repeating node&amp;#39;s parent&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; repeatingNodeParent &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XPathNavigator = _&lt;br /&gt;&amp;nbsp;&amp;nbsp; MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;&lt;strong&gt;&lt;u&gt;my:myFields/my:group1&lt;/u&gt;&lt;/strong&gt;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager)&lt;br /&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;nbsp;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;#39; Get the selected position, which is stored as a property of this node.&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;strong&gt;&lt;em&gt;&amp;#39; The value that corresponds to CTRL1_5 can be found in the Master table&amp;#39;s properties in the designer&lt;/em&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; selectedPos &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&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;String&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;Me&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.MainDataSource.GetNamedNodeProperty(repeatingNodeParent, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;&lt;strong&gt;&lt;u&gt;CTRL1_5&lt;/u&gt;&lt;/strong&gt;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;br /&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; selectedPosInt &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&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;Integer&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;br /&gt;&amp;#39; Make sure it has a value that you can use before using the value&lt;br /&gt;&lt;/font&gt;&lt;/font&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; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Integer&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.TryParse(selectedPos, selectedPosInt) &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;AndAlso&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; selectedPosInt &amp;lt;&amp;gt; 0 &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Then&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; selectedNode &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XPathNavigator = _&lt;br /&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;repeatingNodeParent.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;&lt;strong&gt;&lt;u&gt;my:group2&lt;/u&gt;&lt;/strong&gt;[&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &amp;amp; selectedPosInt &amp;amp; &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;br /&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;MessageBox.Show(selectedNode.OuterXml)&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Else&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&amp;#39; there is nothing you can do because the view is changed or the control has no rows.&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&amp;#39; show an error message or something&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;MessageBox.Show(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;The Master/Destail control has no row selected.&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;End&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;If&lt;/p&gt;&lt;/blockquote&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: Using Visual Basic/VSTO, identify currently selected row of master/detail repeating table</title><link>https://www.infopathdev.com:443/forums/thread/47153.aspx</link><pubDate>Fri, 18 Sep 2009 23:15:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:47153</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/47153.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=47153</wfw:commentRss><description>&lt;p&gt;Hi -- a lot depends on what event you are programming to. For example, in a Changed event for a field in a repeating group, you can use e.Site (IP 2007). Can you tell us more about what you are trying to do? Are you using InfoPath 2003 or InfoPath 2007? Once you know what row is selected, what do you intend to do? Oh, and there is a Context Changed event (OnContextChange in IP 2003)&amp;nbsp;that you can use, too.... &lt;/p&gt;</description></item><item><title>Using Visual Basic/VSTO, identify currently selected row of master/detail repeating table</title><link>https://www.infopathdev.com:443/forums/thread/47115.aspx</link><pubDate>Thu, 17 Sep 2009 18:33:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:47115</guid><dc:creator>GMLear</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/47115.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=47115</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m going to simplify my question.&amp;nbsp; How, within Visual Basic can I determine the selected row of a repeating table within the InfoPath form?&amp;nbsp; It seems to me I should be able to reference the repeating table object.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;---------------------------------------------------------------------------------------------------------------------------- &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Old posting:&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;How do I go about, in Visual Basic/VSTO, identifying the currently selected row in a repeating table that&amp;#39;s part of a master/detail relationship?&amp;nbsp; The JScript solutions I find don&amp;#39;t seem to translate to VB.&lt;/p&gt;&lt;p&gt;&amp;nbsp;I&amp;#39;m not a strong programmer, but am comfortable in VBA and can manipulate/get properties of objects in Excel and Word.&amp;nbsp; I just can&amp;#39;t find a correlate way within the InfoPath/VB environment.&lt;/p&gt;&lt;p&gt;&amp;nbsp;I&amp;#39;ve done my due diligence (about four hours worth) in trying to find the solution on my own, but have come up empty-handed.&amp;nbsp; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>