<?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: Programatically populate and clear a listbox</title><link>https://www.infopathdev.com:443/forums/thread/66138.aspx</link><pubDate>Mon, 25 Apr 2011 16:07:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66138</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66138.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66138</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;That example already has a RemoveFirstItem() function. A poor-man&amp;#39;s way to accomplish this it to figure out how many options there are, and call this function that many times. But that isn&amp;#39;t very efficient. You can try to set the InnerXml to an empty string. This works most of the time, but sometimes it gives an error. Or you can try the DeleteRange method as described here: http://vspug.com/ssa/2008/01/15/infopath-delete-file-attachments-programmatically-c/&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Programatically populate and clear a listbox</title><link>https://www.infopathdev.com:443/forums/thread/66096.aspx</link><pubDate>Thu, 21 Apr 2011 18:22:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66096</guid><dc:creator>Joemanc</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66096.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66096</wfw:commentRss><description>&lt;p&gt;Hi Greg,&lt;/p&gt;
&lt;p&gt;I understand that, but how? I need an example that will work with the &lt;a class="" href="http://www.bizsupportonline.net/infopath2007/programmatically-fill-populate-drop-down-list-box-infopath-2007.htm"&gt;example&lt;/a&gt; that populates the listbox. Can you point me towards one?&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;</description></item><item><title>Re: Programatically populate and clear a listbox</title><link>https://www.infopathdev.com:443/forums/thread/66029.aspx</link><pubDate>Tue, 19 Apr 2011 22:25:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66029</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66029.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66029</wfw:commentRss><description>&lt;p&gt;You need to remove all the option nodes to clear out the list box.&lt;/p&gt;&lt;p&gt;So you start of with something like:&lt;/p&gt;&lt;p&gt;&amp;lt;Options&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Option/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Option/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Option/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Option/&amp;gt;&lt;br /&gt;
&amp;lt;/Options&amp;gt;&lt;/p&gt;&lt;p&gt;And you need to delete all the option nodes so that it looks like this in your DOM: &lt;/p&gt;&lt;p&gt;&amp;lt;Options&amp;gt;&lt;br /&gt;
&amp;lt;/Options&amp;gt;&lt;/p&gt;</description></item><item><title>Programatically populate and clear a listbox</title><link>https://www.infopathdev.com:443/forums/thread/66016.aspx</link><pubDate>Tue, 19 Apr 2011 17:57:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66016</guid><dc:creator>Joemanc</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66016.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66016</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m having a devil of a time trying to clear a listbox programatically in InfoPath 2007.&lt;/p&gt;
&lt;p&gt;I found this &lt;a class="" href="http://www.bizsupportonline.net/infopath2007/programmatically-fill-populate-drop-down-list-box-infopath-2007.htm"&gt;example&lt;/a&gt;&amp;nbsp;on how to populate a listbox programatically. I was able to incorporate this example into my code and it works correctly. But I have not been able to&amp;nbsp;find&amp;nbsp;or write&amp;nbsp;any code that will reset/clear the listbox&amp;nbsp;so that I can then re-populate it from scratch. Some results I received&amp;nbsp;- I&amp;#39;ve gotten error messages; I was able to clear out the listbox but was not able to re-populate it; I cleared out the listbox and it re-populated correctly, but 1 of the previous search ID values&amp;nbsp;appears in the listbox.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried &lt;a class="" href="http://www.bizsupportonline.net/blog/2009/08/clear-reset-fields-infopath-3-lines-code/"&gt;this&lt;/a&gt;, &lt;a class="" href="http://www.bizsupportonline.net/infopath2007/how-to-submit-items-rows-repeating-table-infopath-sharepoint-list.htm"&gt;this&lt;/a&gt;(Part 6)&amp;nbsp;and rules to clear fields, all to no avail. Any ideas on how to reset a listbox using the working example above? Or is there another working example out there that both populates and clears a listbox?&lt;/p&gt;
&lt;p&gt;Joe&lt;/p&gt;</description></item></channel></rss>