How to modify PropertyGrid at runtime (add/remove property and dynamic types/enums)

前端 未结 4 1934
我寻月下人不归
我寻月下人不归 2020-12-05 02:49

How do you modify a propertygrid at runtime in every way? I want to be able to add and remove properties and add \"dynamic types\", what I mean with that is a type that resu

4条回答
  •  庸人自扰
    2020-12-05 03:40

    Ah, of course!

    myProperties.Add(new CustomProperty("Custom", "", typeof(States), false, true));
    
    [TypeConverter(typeof(StatesList))]
    public class States
    {
    }
    

    Works like a charm, thank you!

    I have updated my project, hope it can be helpful to others, it can be found here.

提交回复
热议问题