<?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: Dynamically populate a DropownList with managed code</title><link>https://www.infopathdev.com:443/forums/thread/45501.aspx</link><pubDate>Thu, 06 Aug 2009 00:15:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:45501</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/45501.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=45501</wfw:commentRss><description>&lt;p&gt;Hi JWoah12,&lt;/p&gt;
&lt;p&gt;You don&amp;#39;t need code to do that. Create a data connection (Tools-&amp;gt;Data Connection) to retrieve data from the SharePoint list. Double click the dropdown in the view and choose to populate from the external data. You can even choose to have the display and value be different.&lt;/p&gt;</description></item><item><title>Dynamically populate a DropownList with managed code</title><link>https://www.infopathdev.com:443/forums/thread/45292.aspx</link><pubDate>Fri, 31 Jul 2009 20:09:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:45292</guid><dc:creator>jwoah12</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/45292.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=45292</wfw:commentRss><description>&lt;p&gt;I have an InfoPath form with custom C# code, and a Sharepoint list.
I have a dropdownlist in the InfoPath form that I want to populate with
a certain field from the Sharepoint list (I want the InfoPath
dropdownlist to contain this field&amp;#39;s value from every item in the
Sharepoint list. I can successfully get the list of values I need from
Sharepoint in my managed code, but I do not see how I can get these
values into the dropdownlist (either bind to the list, or add each item
in the list one by one). I thought I could modify the XML of the
dropdownlist to insert my items, but the XML only contains the first
item in the dropdownlist: &lt;/p&gt;

&lt;pre class="prettyprint"&gt;&lt;code&gt;&lt;span class="pln"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;my:RelatedRiskID&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="atn"&gt;xmlns:my&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="atv"&gt;&amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-07-20T18:12:59&amp;quot;&lt;/span&gt;&lt;span class="pun"&gt;&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;Option 1&lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;my:RelatedRiskID&lt;/span&gt;&lt;span class="pun"&gt;&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I feel like this should be possible, but I can&amp;#39;t find any resources on how to do it.  Thanks in advance for the help.&lt;/p&gt;</description></item></channel></rss>