I'm trying to loop through a multiple list dropdown and I'm having issues.
Everywhere online states that the returned value is a comma-separated list so I assumed a string would be returned which I could then loop through using a .Split(',') but this doesn't seem to work.
Dropdown list multiple
Hi all,
I'm trying to loop through a multiple list dropdown and I'm having issues.
Everywhere online states that the returned value is a comma-separated list so I assumed a string would be returned which I could then loop through using a .Split(',') but this doesn't seem to work.
If i do this i get the following outputs:
System.Linq.Enumerable+WhereSelectArrayIterator`2[System.String System.String]
I have followed the tutorial on http://www.computermagic.gr/tutorials/umbraco-7/property-editors/dropdown-list-multiple/
Here is the code i have:
I have also tried casting the item to an array thinking this may be an issue by both declaring the item as a
Any help?!
Lewis
Hi Lewis,
Can you try to use something like this:
Please keep in mind that you change it so it match your case.
Hope this helps,
/Dennis
What version of Umbraco are you using?
In theory you should be able to just do this:
This returns an array of strings.
However, when I tried this in Umbraco 7.9.2 the collection was always empty. I think there must be a bug in this version.
If you check your umbraco.config file in /App_Data/ can you see your ringCategory property on any of your documents?
Thanks Dan! I'm in 7.12.1 and it works as you described.
is working on a reply...