<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Infopath combobox/dropdown box</title><link>https://www.infopathdev.com:443/forums/thread/64937.aspx</link><pubDate>Mon, 07 Mar 2011 20:46:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:64937</guid><dc:creator>muddu_shafi</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/64937.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=64937</wfw:commentRss><description>I want to programatically fill values for the combox by reading values from external datasource (Sharepoint list).&lt;br /&gt;
I am using C#.&lt;br /&gt;

I have connected my combobox control to this SPList to retieve rows. My SPList has name of employees, salaries and department.&lt;br /&gt;
Now depending on the salary entered by the User, I want to show the list of employees(dropdown) having salaries greater than entered value in the dropdown box. 
&lt;br /&gt;
&lt;b&gt;
My thought:-
&lt;/b&gt;
I am thinking of using listbox changed event to fill the dropdown box. I think that as I am already connected to list, on load the combobox has list of all employees. I probably have to delete them when the textbox values changes and then add/fill values to that combobox.&lt;br /&gt;
&lt;pre&gt;
            XPathNavigator root = MainDataSource.CreateNavigator();
            string salary = root.SelectSingleNode(&amp;quot;//my:salary&amp;quot;, NamespaceManager).Value;

            // Retrieve a reference to the SharePoint list
            XPathNavigator secDS = DataSources[&amp;quot;ESalaries&amp;quot;].CreateNavigator();
           
            // Search for the email address in the SharePoint list
            XPathNavigator contact = secDS.SelectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/dfs:ESalaries[@salaries &amp;gt;= &amp;quot; + salary + &amp;quot;]&amp;quot;,
            NamespaceManager);
&lt;/pre&gt;
          The above statement is not working, coz i assume that the salaries&amp;gt;=salary will return a list of String values instead of a single value. And next, how do I iterate through the returned values and add them to the combobox.


Please please help me with the code......</description></item></channel></rss>