Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I found some examples for v7 and earlier, but not for v8.
Anyone knows how to do this?
I have so far:
public static void SetDataTypePreValues(int id, List<string> values)
var dataTypeService = Current.Services.DataTypeService;
var dataType = dataTypeService.GetDataType(id); // this is the dropdownlist
// and now???
Thank you for your help.
What I did for now is:
var valueList = (ValueListConfiguration)dataType.Configuration;
var lastId = valueList.Items.LastOrDefault()?.Id;
var newValueList = new List<ValueListConfiguration.ValueListItem>();
var idCounter = lastId ?? 0;
foreach (var val in values)
Id = idCounter,
Value = val
I don't know if this is the best way to do it, but at least it works.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted