I am having some issues with setting a value for a radiobuttonlist. I have been able to set the values for nested content, checkbox lists etc but this one has me stumped and the documentation doesn't seem to exist, even when things have broken from 7 to 8.
Does anyone know what i have to pass to setValue to get it to populate the radio buton list selected value? I have sent the value, the id, the value and id, the value as an array etc, etc. and it still sits there unset.
I am on version 8.1 and created a Radio Button List datatype with 2 options ["Grid List" and "Table List"]. I tried to save with the name and it worked fine.
var obj = _contentService.GetById(1074);
obj.SetValue("eventType", "Grid List");
_contentService.SaveAndPublish(obj);
Also I have checked in the table Select * from umbracoPropertyData table that it stores as text value so no id is required anymore.
Thanks for input, gave me the direction i needed to fix my solution. For anyone insterested, here is how i am getting the preValues from a list of selected item(s), needs to be made more general but hopefully gives people an idea.
Set RadioButtonList selected value programatially
Hi all,
I am having some issues with setting a value for a radiobuttonlist. I have been able to set the values for nested content, checkbox lists etc but this one has me stumped and the documentation doesn't seem to exist, even when things have broken from 7 to 8.
Does anyone know what i have to pass to setValue to get it to populate the radio buton list selected value? I have sent the value, the id, the value and id, the value as an array etc, etc. and it still sits there unset.
Any help would be greatly appreciated.
Hi Roberto,
I am on version 8.1 and created a Radio Button List datatype with 2 options ["Grid List" and "Table List"]. I tried to save with the name and it worked fine.
Also I have checked in the table Select * from umbracoPropertyData table that it stores as text value so no id is required anymore.
Hope this helps.
Regards,
Shaishav
Hi Shaishav,
Thanks for input, gave me the direction i needed to fix my solution. For anyone insterested, here is how i am getting the preValues from a list of selected item(s), needs to be made more general but hopefully gives people an idea.
`
is working on a reply...