Hello there, I'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: "2;#red;#12;#blue". number and name are one line in the list i.e.
articlenumber: 2 name: red
articlenumber 12 name: blue
I hope you can imagine.
I create entries for each color-value pair in my main data source. On the left side you see an image of my main data source. The color-value pairs are located in:
myFields/Bestellungen/Bestellung/ddArtikel/artikel/ddFarben/ddFarbe
The nodenames are: ddFarbeNr <- for the number, ddFarbeText <- for the name of the color
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 "#" are removed. The split is saved into aFarben.
for (int i = 0; i < aFarben.Length; i++)
{
if (i % 2 == 1)
{
String sDDFarben = "<my:ddFarbe><my:ddFarbeNr>"+ aFarben[i-1] +"</my:ddFarbeNr>"+
"<my:ddFarbeText>"+ aFarben[i] +"</my:ddFarbeText></my:ddFarbe>";xnFarben.SelectSingleNode("../my:ddFarben", NamespaceManager).AppendChild(sDDFarben);
}
}
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't add. The xml string has exact the right values inside. How can it be that there are empty line in the dropdown ?
Thanks in advance.
Regards Matthias