
I am using the EnumPropertyEditor to display some enum values to pick from in a property grid. It is fantastically designed to support switching between CheckBox & RadioButton display modes based on whether the enum has the Flags attribute implemented. My issue is that I need to conditionally change the display mode from CheckBox to RadioButton for a enum that has the flags attribute and cannot figure out how to properly do this.
Since I will need to conditionally do this for specific scenarios I created my own custom class that inherits EnumPropertyEditor that I use to control the display mode:
public class MyEnumPropertyEditor : EnumPropertyEditor
{
public MyEnumPropertyEditor()
{
// How do I change the display mode for the EnumListBox that will be created for this editor instance?
EnumListBoxDisplayMode.RadioButton;
}
}
[DisplayName("Some Display")]
[Editor(typeof(MyEnumPropertyEditor), typeof(UITypeEditor))]
public EnumWithFlags SomeEnumProperty { get; set; }
Any help in solving this would be appreciated.