<?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: empty entries in drop down list</title><link>https://www.infopathdev.com:443/forums/thread/35196.aspx</link><pubDate>Wed, 03 Dec 2008 06:51:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35196</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35196.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=35196</wfw:commentRss><description>&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;Hello,&lt;/span&gt; 
&lt;p&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;Thanks for letting us know. Glad to be of help :)&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: empty entries in drop down list</title><link>https://www.infopathdev.com:443/forums/thread/35083.aspx</link><pubDate>Mon, 01 Dec 2008 12:26:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35083</guid><dc:creator>tylkomat</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35083.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=35083</wfw:commentRss><description>&lt;p&gt;I found the error. It was in another function. I was deleting the Nodes before and created new ones, maybe there were too much. Anyway it works correct now. Thank you for trying to help me Shiva.&lt;/p&gt;</description></item><item><title>Re: empty entries in drop down list</title><link>https://www.infopathdev.com:443/forums/thread/35067.aspx</link><pubDate>Mon, 01 Dec 2008 08:43:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35067</guid><dc:creator>tylkomat</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35067.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=35067</wfw:commentRss><description>&lt;p&gt;Hello Shiva, thank you for your advice. I have testet it and the String always contains the correct values. Not more, not less. Any other ideas ?&lt;/p&gt;</description></item><item><title>Re: empty entries in drop down list</title><link>https://www.infopathdev.com:443/forums/thread/35039.aspx</link><pubDate>Sat, 29 Nov 2008 06:58:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:35039</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/35039.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=35039</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You have to debug for below line,&lt;/p&gt;
&lt;p&gt;xnFarben.SelectSingleNode(&amp;quot;../my:ddFarben&amp;quot;, NamespaceManager).AppendChild(sDDFarben);&lt;/p&gt;
&lt;p&gt;In this ‘sDDFarben&amp;#39; node is empty for some times. For every node adding in your for loop, you have to check the ‘sDDFarben&amp;#39; node contains value or not.&lt;/p&gt;
&lt;p&gt;Hope this helps you.&lt;/p&gt;</description></item><item><title>Re: empty entries in drop down list</title><link>https://www.infopathdev.com:443/forums/thread/34996.aspx</link><pubDate>Thu, 27 Nov 2008 15:00:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34996</guid><dc:creator>tylkomat</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34996.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=34996</wfw:commentRss><description>&lt;p&gt;The function you postet does not work. SelectSingleNode has a return value an XPathNavigator object. Here are some images to show what I mean. One entry is correct and the other ones are not. I don&amp;#39;t know why. They all use the same functions. &lt;/p&gt;
&lt;p&gt;&lt;img title="drag drop list middle correct" style="WIDTH:584px;HEIGHT:302px;" height="302" alt="drag drop list middle correct" src="http://img3.imagebanana.com/img/qo0ooxs6/dd2.gif" width="584" align="left" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img title="Drag drop list correct" style="WIDTH:573px;HEIGHT:122px;" height="122" alt="Drag drop list correct" src="http://img3.imagebanana.com/img/oitra1ul/dd1.gif" width="573" align="left" /&gt;&lt;/p&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;
&lt;p&gt;&amp;nbsp;&lt;/p&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;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img title="drag drop top correct" style="WIDTH:589px;HEIGHT:541px;" height="541" alt="drag drop top correct" src="http://img3.imagebanana.com/img/y8istwtr/dd3.gif" width="589" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Before adding the values I always delete all the nodes inside the ddFarben node. Here is my code:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; Artikelnummer_Changed(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#008080" size="2"&gt;XmlEventArgs&lt;/font&gt;&lt;font size="2"&gt; e)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;try&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; xnFarben = e.Site.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;..//my:tempFarbe[../my:ddArtikelnummer = ../../../my:Artikelnummer]&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;MessageBox&lt;/font&gt;&lt;font size="2"&gt;.Show(xnFarben.InnerXml);&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt; sFarben = xnFarben.InnerXml;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;sFarben = sFarben.Replace(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;#&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;,&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;char&lt;/font&gt;&lt;font size="2"&gt;[] split = {&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;#39;;&amp;#39;&lt;/font&gt;&lt;font size="2"&gt;};&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt;[] aFarben = sFarben.Split(split);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;List&lt;/font&gt;&lt;font size="2"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt;&amp;gt; nodesToDelete = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#008080" size="2"&gt;List&lt;/font&gt;&lt;font size="2"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt;&amp;gt;();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;foreach&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; option &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;in&lt;/font&gt;&lt;font size="2"&gt; xnFarben.Select(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;..//my:ddFarbe&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager))&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;nodesToDelete.Add(option);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//delete all nodes on the list&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;foreach&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; option &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;in&lt;/font&gt;&lt;font size="2"&gt; nodesToDelete)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;option.DeleteSelf();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;for&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; i = 0; i &amp;lt; aFarben.Length; i++)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt; (i % 2 == 1)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt; sDDFarben = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;&amp;lt;my:ddFarbe&amp;gt;&amp;lt;my:ddFarbeNr&amp;gt;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;+ aFarben[i-1] +&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;&amp;lt;/my:ddFarbeNr&amp;gt;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;+&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;&amp;lt;my:ddFarbeText&amp;gt;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;+ aFarben[i] +&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;&amp;lt;/my:ddFarbeText&amp;gt;&amp;lt;/my:ddFarbe&amp;gt;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/p&gt;xnFarben.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;../my:ddFarben&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).AppendChild(sDDFarben);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;catch&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Exception&lt;/font&gt;&lt;font size="2"&gt; ex)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;MessageBox&lt;/font&gt;&lt;font size="2"&gt;.Show(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;Message:\n&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; + ex.Message + &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;\nDetail:\n&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; + &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;\nStackTrace\n&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; + ex.StackTrace);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;I don&amp;#39;t know why it is different for the articles. Maybe it has something to do with the Sharepoint lookup. I don&amp;#39;t know. When I retrieve the xml currently used there is everything allright, but anyhow there are these empty lines.&lt;/p&gt;</description></item><item><title>Re: empty entries in drop down list</title><link>https://www.infopathdev.com:443/forums/thread/34993.aspx</link><pubDate>Thu, 27 Nov 2008 13:53:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34993</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34993.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=34993</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Where you are getting empty entries in your dropdown list? If it is in starting then you have to change the code as below before adding the nodes.&lt;/p&gt;
&lt;p&gt;Delete all child nodes for below node,&lt;/p&gt;
&lt;p&gt;XmlNode ddFarbenNode = xnFarben.SelectSingleNode(&amp;quot;../my:ddFarben&amp;quot;, NamespaceManager);&lt;/p&gt;
&lt;p&gt;ddFarbenNode. RemoveAll();&lt;/p&gt;
&lt;p&gt;If the blank entries in the middle then you have to check code in your for loop. You might be adding some empty nodes to ddFarbenNode.&lt;/p&gt;</description></item><item><title>empty entries in drop down list</title><link>https://www.infopathdev.com:443/forums/thread/34987.aspx</link><pubDate>Thu, 27 Nov 2008 12:42:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34987</guid><dc:creator>tylkomat</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34987.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=34987</wfw:commentRss><description>&lt;p&gt;&lt;img title="main data source" style="WIDTH:196px;HEIGHT:651px;" height="651" alt="main data source" src="http://img3.imagebanana.com/img/y60o4y/maindatasource.jpg" width="196" align="left" /&gt;Hello there, I&amp;#39;m populating a List through code. I get the entries for the dropdown from a sharepoint list which has a lookup. The list holds informations about articles and has a lookup the specific colors for each article. Through the lookup I get a String for the colors which looks like this: &amp;quot;2;#red;#12;#blue&amp;quot;. number and name are one line in the list i.e.&lt;/p&gt;
&lt;p&gt;articlenumber: 2 name: red&lt;/p&gt;
&lt;p&gt;articlenumber 12 name: blue&lt;/p&gt;
&lt;p&gt;I hope you can imagine.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I create entries for each color-value pair in my main data source.&amp;nbsp; On the left side you see an image of my main data source. The color-value pairs are located in:&lt;/p&gt;
&lt;p&gt;myFields/Bestellungen/Bestellung/ddArtikel/artikel/ddFarben/ddFarbe&lt;/p&gt;
&lt;p&gt;The nodenames are: ddFarbeNr &amp;lt;- for the number, ddFarbeText &amp;lt;- for the name of the color&lt;/p&gt;
&lt;p&gt;I create xml strings for every color and add them to ddFarben, right before the string (i.e.: 2;#red;#12;#blue) is splitted and &amp;quot;#&amp;quot; are removed. The split is saved into aFarben.&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;for&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; i = 0; i &amp;lt; aFarben.Length; i++)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt; (i % 2 == 1)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt; sDDFarben = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;&amp;lt;my:ddFarbe&amp;gt;&amp;lt;my:ddFarbeNr&amp;gt;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;+ aFarben[i-1] +&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;&amp;lt;/my:ddFarbeNr&amp;gt;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;+&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;&amp;lt;my:ddFarbeText&amp;gt;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;+ aFarben[i] +&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;&amp;lt;/my:ddFarbeText&amp;gt;&amp;lt;/my:ddFarbe&amp;gt;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/p&gt;xnFarben.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;../my:ddFarben&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).AppendChild(sDDFarben);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I added color values for different articles in the sharepoint list. One article shows everything correct. The other ones have empty entries before and/or after the color entries. Which I didn&amp;#39;t add. The xml string has exact the right values inside. How can it be that there are empty line in the dropdown ?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;
&lt;p&gt;Regards Matthias&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>