Cannot split values from UltimatePicker with less than 8 items
Umbraco 4.7
I have an UltimatePicker (checklist), when there is check 1 to 7 checked items a strange thing happens in Razor - It works fine in XLST. The seperator (,) is removed when I try to get the value from the property.
Debugging I can see in the PropertiesAsList that the value is "1964,1965,1966,1967,1968,1969,1970"
Doing a: var temp = node.propertyname; Results in "1964196519661967196819691970"
If there is 8 or more in the list, the seperator (,) will not be removed.
Code
var node = @Model.NodeById(2603); string s = node.productgroups; //productgroups is a property of UltimatePicker
Debug error message is that decimal cannot be converted to string. So "node.productgroups" returns decimal when less than 8 items and string when more than 7 items.
Is this a bug or a special feature. Has anybody else this problem?
Cannot split values from UltimatePicker with less than 8 items
Umbraco 4.7
I have an UltimatePicker (checklist), when there is check 1 to 7 checked items a strange thing happens in Razor - It works fine in XLST. The seperator (,) is removed when I try to get the value from the property.
Debugging I can see in the PropertiesAsList that the value is "1964,1965,1966,1967,1968,1969,1970"
Doing a: var temp = node.propertyname;
Results in "1964196519661967196819691970"
If there is 8 or more in the list, the seperator (,) will not be removed.
Code
Debug error message is that decimal cannot be converted to string. So "node.productgroups" returns decimal when less than 8 items and string when more than 7 items.
Is this a bug or a special feature. Has anybody else this problem?
- Mikkel Johansen
It is caused by the DynamicNode duck typing your value as an Int.
Try using the GetProperty method to work around the problem.
is working on a reply...