See if this is what you are looking for, replaced Hours
with your model.
To see where this came from see the following.
internal class Editor : UITypeEditor
{
private IWindowsFormsEditorService _svc;
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.DropDown;
}
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
_svc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
var listBox = new ListBox();
var hours = new Hours();
var data = hours.Range(ParentIncrement);
foreach (var item in data)
{
listBox.Items.Add(item);
}
if (value != null)
{
listBox.SelectedItem = value;
}
_svc.DropDownControl(listBox);
value = (string)listBox.SelectedItem;
return value;
}
}