How do I allow a “flag” enum to be edited in the WinForm PropertyGrid?
Asked Answered
N

1

12

The WinForm PropertyGrid copes well with a standard enum but does does have a built in editor for a flag enum. Someone must have written one, I rather not reinvent the weel.

I am looking for an editor that puts a checkbox next to each member of the enum so the user can control the members that are included. My enum looks like:

  [Flags]
  public enum AutoPricingCalendar
  {
        Sunday = 1,
        Monday = 2,
        Tuesday = 4,
        Wednesday = 8,
        Thursday = 16,
        Friday = 32,
        Saturday = 64,
   }
Neumark answered 21/4, 2011 at 13:40 Comment(0)
D
14

CodeProject: A UITypeEditor for easy editing of flag enum properties in the property browser

Denis answered 21/4, 2011 at 13:43 Comment(1)
Thanks I have just added this to may project and it worked first time.Neumark

© 2022 - 2024 — McMap. All rights reserved.