Hi,
Just wondering how you go about getting the string list of items from a radiobutton datatype. The only examples of this I could find are old and use deprecated methods.
No, I need to basically use the radiobutton values to choose which types of pages to search for, on one page I do not have the radiobuttons themseleves and need to look at all options.
So i just need the radiobutton values from a radiobutton type. Not a variable that is present on the currentpage.
Where 1001 = the ID of the DataType you wish to access.
You can look this up in the back office, it's the integer on the end of the URL:
I find it's easier to put this value in a config file to reduce the number of magic strings in your code. It shouldn't change during the lifetime of your application.
Retrieving the values for a radiobutton data type
Hi, Just wondering how you go about getting the string list of items from a radiobutton datatype. The only examples of this I could find are old and use deprecated methods.
Hi Damien,
Did you try this code?
Read more - https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/radiobutton-list
I hope it will help you!
Thanks,
Alex
Hi Alex, This is a datatype that is not in use on the CurrentPage/Model.
Basically I have a pre-existing radiobutton datatype that needs to be read into a list on another page.
Hi Damien,
So do you need to create radiobutton list on another page? Or read selected value on another page?
Thanks,
Alex
No, I need to basically use the radiobutton values to choose which types of pages to search for, on one page I do not have the radiobuttons themseleves and need to look at all options.
So i just need the radiobutton values from a radiobutton type. Not a variable that is present on the currentpage.
If I understand you correctly; you want to get the Prevalues from an existing Datatype that you have set?
If so, you can get Prevalues by using the DataTypeService as follows:
Where 1001 = the ID of the DataType you wish to access.
You can look this up in the back office, it's the integer on the end of the URL:
I find it's easier to put this value in a config file to reduce the number of magic strings in your code. It shouldn't change during the lifetime of your application.
Hey is there any way to programmatically find this number?
I may want to export then import this setup and all the numbers get screwed around when you do that.
is working on a reply...