<?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: programmatically populating drop down list with data from array</title><link>https://www.infopathdev.com:443/forums/thread/75185.aspx</link><pubDate>Sun, 12 Feb 2012 12:10:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:75185</guid><dc:creator>Skarn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/75185.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=75185</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;ok, cool :-) But...could you have just put a filter on the droplist which only selects the values which contain the text of the filter field?&lt;/p&gt;&lt;p&gt;Like what I&amp;#39;ve attached. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: programmatically populating drop down list with data from array</title><link>https://www.infopathdev.com:443/forums/thread/75096.aspx</link><pubDate>Wed, 08 Feb 2012 18:39:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:75096</guid><dc:creator>gr8fasushi</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/75096.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=75096</wfw:commentRss><description>funny how you resolve your own problems after you post on a forum for help.  I finally figured it out.  I&amp;#39;ll post my solution for other people should they run into my same problem:&lt;br /&gt;&lt;br /&gt;

                &amp;#39;To populate a dropdown list in Infopath, you need to create a repeating group field which I named &amp;quot;Vendor&amp;quot; and a dropdownlist field under that which I named &amp;quot;ddlVendorName1&amp;quot;.&lt;br /&gt;
                &amp;#39;Set xpnRootNode to myFields (the root group), set xpnDataGroup to the repeating group created above.  Run through the array and display the contents into the &lt;br /&gt;
                &amp;#39;list box by cloning xpnTemplate, setting the value of ddlVendorName, and use the InsertAfter method.&lt;br /&gt;
                &amp;#39;deleteself after the loop to remove duplicate listings&lt;br /&gt;&lt;br /&gt;
                Dim xpnRootNode As XPathNavigator = nav.SelectSingleNode(&amp;quot;/my:myFields&amp;quot;, NamespaceManager)&lt;br /&gt;
                Dim xpnDataGroup As XPathNavigator = nav.SelectSingleNode(&amp;quot;//my:myFields/my:Vendor&amp;quot;, NamespaceManager)&lt;br /&gt;
                Dim xpnTemplate As XPathNavigator = xpnDataGroup.Clone()&lt;br /&gt;
                For i As Integer = 0 To (count - 1)     &amp;#39;This loops through my array with data to display.  my array name is called arrayList&lt;br /&gt;
                    Dim xpnNewData As XPathNavigator = xpnTemplate.Clone()&lt;br /&gt;
                    xpnNewData.SelectSingleNode(&amp;quot;/my:myFields/my:Vendor/my:ddlVendorName1&amp;quot;, NamespaceManager).SetValue(arrayList(i))&lt;br /&gt;
                    xpnDataGroup.InsertAfter(xpnNewData)&lt;br /&gt;
                Next&lt;br /&gt;
                xpnDataGroup.DeleteSelf()&lt;br /&gt;</description></item><item><title>Re: programmatically populating drop down list with data from array</title><link>https://www.infopathdev.com:443/forums/thread/75075.aspx</link><pubDate>Tue, 07 Feb 2012 23:22:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:75075</guid><dc:creator>gr8fasushi</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/75075.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=75075</wfw:commentRss><description>I&amp;#39;ve made some progress, but it&amp;#39;s still not working the way it should.  I have it working so it now can show the last item of the array in the drop down list.  Here is my code so far:&lt;br /&gt;&lt;br /&gt;

                Dim group1 As XPathNavigator = nav.SelectSingleNode(&amp;quot;/my:myFields/my:Vendor&amp;quot;, NamespaceManager)&lt;br /&gt;
                Dim field As XPathNavigator = nav.SelectSingleNode(&amp;quot;/my:myFields/my:Vendor/my:ddlVendorName&amp;quot;, NamespaceManager)&lt;br /&gt;
                Dim newNode As XPathNavigator&lt;br /&gt;
                For i As Integer = 0 To (count - 1)&lt;br /&gt;
                    newNode = group1.Clone()&lt;br /&gt;
                    newNode.SelectSingleNode(&amp;quot;/my:myFields/my:Vendor/my:ddlVendorName&amp;quot;, NamespaceManager).SetValue(arrayList(i))&lt;br /&gt;
                    group1.InsertAfter(newNode)&lt;br /&gt;
                    newNode = Nothing&lt;br /&gt;
                Next&lt;br /&gt;&lt;br /&gt;

It&amp;#39;s still not populating all the array data.  Any suggestions that I may be overlooking?

thanks</description></item><item><title>programmatically populating drop down list with data from array</title><link>https://www.infopathdev.com:443/forums/thread/75018.aspx</link><pubDate>Mon, 06 Feb 2012 22:37:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:75018</guid><dc:creator>gr8fasushi</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/75018.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=75018</wfw:commentRss><description>Hi guys,

I&amp;#39;m running into an issue trying to programmatically populate a drop down list with data from an array.  The reason I need to do this programmatically is because the original datasource brings back approximately 7000 rows of data - needless to say this slows down my infopath form greatly.  My solution is to have the user type the search word in a text box, and when they click query, it will only pull the matching records from the database.

I have everything working up to this point.  I can type in a search word, and have all results that are found to be inserted into an array.

My problem now is trying to display the search results into my drop down list.  This should be very simple in theory, but i&amp;#39;m running into a wall trying to work around this in Infopath.

I guess my question has two parts - understand navigating these xml elements when it comes to drop down lists - and the proper syntax to execute it.

I have a repeating group called Vendor (&amp;quot;/my:myFields/my:Vendor&amp;quot;) with a field called ddlVendorName (&amp;quot;/my:myFields/my:Vendor/my:ddlVendorName&amp;quot;) in this group.

I appreciate any input or advice!

thanks,</description></item></channel></rss>