Using PropertyGrid and Collection Editor
-
Hello, I have 3 classes for example : public MainClass { private int maximum = 100; private int minimum = 0; private int valueC = 50; [Browsable(true)] public int Maximum { get {return maximum ;} set {maximum =value;} } [Browsable(true)] public int Minimum { get {return minimum ;} set {minimum =value;} } [Browsable(true)] public int ValueC { get {return valueC ;} set {valueC=value;} } public MainClass() { } } public ElementsClass { private PropertiesClass elementsProperties; [Browsable(true)] public PropertiesClass ElementsProperties { get {return elementsProperties;} set {elementsProperties =value;} } public ElementClass() { } } public PropertiesClass { private bool visible = true; private Color colorC = Color.Black; private bool blink = true; [Browsable(true)] public bool Visible { get {return visible;} set {visible =value;} } [Browsable(true)] public Color ColorC { get {return colorC;} set {colorC=value;} } [Browsable(true)] public bool Blink { get {return blink;} set {blink=value;} } public PropertiesClass() { } } In the MainClass i want to include a ElementClass property but i must be able to have an ElementClass array or collection and each ElementClass has the 3 PropertiesClass properties. What i don't know how to do :confused: is the next: I want to show the MainClass properties in a PropertyGrid, the ElementsClass data must open a new window like a collection editor showing a list of all the ElementsClass objects that i have created. Finally when i select some element in the list, the propertyGrid must show the PropertiesClass properties (visible, colorC, blink). Can somebody help me with this? Regards, Alberto Martinez
-
Hello, I have 3 classes for example : public MainClass { private int maximum = 100; private int minimum = 0; private int valueC = 50; [Browsable(true)] public int Maximum { get {return maximum ;} set {maximum =value;} } [Browsable(true)] public int Minimum { get {return minimum ;} set {minimum =value;} } [Browsable(true)] public int ValueC { get {return valueC ;} set {valueC=value;} } public MainClass() { } } public ElementsClass { private PropertiesClass elementsProperties; [Browsable(true)] public PropertiesClass ElementsProperties { get {return elementsProperties;} set {elementsProperties =value;} } public ElementClass() { } } public PropertiesClass { private bool visible = true; private Color colorC = Color.Black; private bool blink = true; [Browsable(true)] public bool Visible { get {return visible;} set {visible =value;} } [Browsable(true)] public Color ColorC { get {return colorC;} set {colorC=value;} } [Browsable(true)] public bool Blink { get {return blink;} set {blink=value;} } public PropertiesClass() { } } In the MainClass i want to include a ElementClass property but i must be able to have an ElementClass array or collection and each ElementClass has the 3 PropertiesClass properties. What i don't know how to do :confused: is the next: I want to show the MainClass properties in a PropertyGrid, the ElementsClass data must open a new window like a collection editor showing a list of all the ElementsClass objects that i have created. Finally when i select some element in the list, the propertyGrid must show the PropertiesClass properties (visible, colorC, blink). Can somebody help me with this? Regards, Alberto Martinez