This depends on which datatype you are using. Most datatypes that allow the user to select multiple values store them either in CSV or XML format. Or are you actually wanting to retrieve the possible "prevalues" (ie for the Dropdown datatype)? Which datatype are you using?
Is this the same question as your other thread? I think the problem was you need to set it to the ID of the prevalue rather than the text value of it. In the above code you could get that from pv.Id
Yep, in that case see what I said above - instead of setting it to "US" you need to set it to the ID of the Prevalue with the Value of "US".
You could get the ID by writing a quick method to enumerate through the prevalues using the above code and find the one you're looking for and grab it's ID.
How I can get all values of data type?
I have data type, that has four different values. How I can get all values of data type or a definite value?
Hi Anton,
This depends on which datatype you are using. Most datatypes that allow the user to select multiple values store them either in CSV or XML format. Or are you actually wanting to retrieve the possible "prevalues" (ie for the Dropdown datatype)? Which datatype are you using?
-Tom
My own datatype, Render Control: Dropdown list. With database datatype Ntext
Hi,
Here's one way to get all the prevalues of your datatype: GetPreValues
Here's another way:
HTH,
Tom
Hi, thanks. And how I can set values? I can create new node, but I dont now how set values in my data type by API.
Is this the same question as your other thread? I think the problem was you need to set it to the ID of the prevalue rather than the text value of it. In the above code you could get that from pv.Id
-Tom
Yes it is the same question.
Yep, in that case see what I said above - instead of setting it to "US" you need to set it to the ID of the Prevalue with the Value of "US".
You could get the ID by writing a quick method to enumerate through the prevalues using the above code and find the one you're looking for and grab it's ID.
-Tom
doc.getProperty(" MY_Dropdown_list_datatype").Id = 18;
'umbraco.cms.businesslogic.property.Property.Id' -- Read only
Sorry, you still want to set the Value of the property, you just want to set it to the ID of the prevalue, ex:
doc.getProperty(" MY_Dropdown_list_datatype").Value = 18;
(or it may be "18" - can't remember)
-Tom
It is work!!!!!!
doc.getProperty(" MY_Dropdown_list_datatype").Value = "18";
Thank you Tom, very much!
is working on a reply...