Hi,
Looking for some assistance in setting a Dropdown value programatically, I was under the impression for a simple Umbraco.DropDown data type I’d just be able to do the following..
ContentService c = new ContentService();
IContent myContent = c.GetById(1054);
myContent.SetValue("status", "Reserved"); // 'status' being the alias for my Umbraco.DropDown data type, 'reserved' being an available prevalue option I've set up on the data type
c.SaveAndPublishWithStatus(myContent);
A member picker, and text field which I’m also updating during the same bit of logic work without a hitch - however the dropdown doesn’t seem to work at all.
I would expect the drop down value to have changed from ‘Available’ to ‘Reserved’ however when I review the content in the backoffice the dropdown has been reset to the default (no) value.
Thought this would be quite straight forward (and apologies if I’ve missed something silly..) but starting to pull my hair out with it a little now, any help would be greatly appreciated!
Thanks
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/54462-set-value-of-umbracodropdown-programatically