<?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: Repeating section value assignment works in button click event and fails in dropdown selection change event</title><link>https://www.infopathdev.com:443/forums/thread/96923.aspx</link><pubDate>Tue, 08 Apr 2014 20:41:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:96923</guid><dc:creator>lcha123</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/96923.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=96923</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;If I use &amp;#39; &lt;em&gt;/my:myFields/my:Purchase/my:PurchaseDetails/my:Quote/my:ControlSwitch&amp;#39;&lt;/em&gt;, it doesn&amp;#39;t throw exception, but it always goes to the first item, instead of current item.&amp;nbsp; If&amp;nbsp; it use &lt;em&gt;my:ControlSwitch&lt;/em&gt; or&lt;em&gt; /my:Quote/my:ControlSwitch, &lt;/em&gt;It throws Null Reference exception, although it is fine when I use &lt;em&gt;my:ControlSwitch&lt;/em&gt; in Button click event&lt;/p&gt;</description></item><item><title>Repeating section value assignment works in button click event and fails in dropdown selection change event</title><link>https://www.infopathdev.com:443/forums/thread/96918.aspx</link><pubDate>Tue, 08 Apr 2014 15:59:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:96918</guid><dc:creator>lcha123</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/96918.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=96918</wfw:commentRss><description>&lt;p&gt;&lt;strong&gt;&amp;nbsp;I can assign&amp;nbsp;value in the button click event.&amp;nbsp; It works fine&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;em&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; NewVendor_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;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;{ &lt;/font&gt;&lt;font size="2"&gt;e.Source.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:ControlSwitch&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;ShowComponent&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;}&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;But I got error when I tried to do the same thing in dropdown box selection change event&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/em&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&amp;nbsp;&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; VendorList_Changed(&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;XmlEventArgs&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; {&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;e.Site.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:ControlSwitch&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;ShowComponent&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;}&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;The function is&amp;nbsp;triggered from here&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;EventManager.XmlEvents[&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:myFields/my:Purchase/my:PurchaseDetails/my:Quote/my:VendorList&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;].Changed += &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XmlChangedEventHandler&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(VendorList_Changed);&lt;/font&gt;&lt;/em&gt;&lt;/p&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></channel></rss>