Hi,
I'm struggling to find a way to return the label of a dropdown option using the API.
Use case:
- I have an Item
var item = Dynamicweb.Services.Items.GetItem("MyItem", "123");
- I get the value of the field x.GetString("MyDropdownField") returns the string
var fieldValue = x.GetString("MyDropdownField");
- This gives me the value "3" (for example), but I want the label "Hello world";
Now how do I get the label for that value? I tried a few things, but nothing on the API seems to stand out.
I know that with ModelViews I have .GetList() and that's contains the properties SelectedValue and SelectedName. But I can't seem to cast an Item into an ItemViewModel.
Best Regards,
Nuno Aguiar