Hide subproperty in PropertyGrid
-
I am using the property grid and have it doing most things in need. the property grid is loaded with custom class and i have used ExpandableObjectConverter to display subproperties. I would like to know if there is a way to hide one or more of these subproperties at runtime. In the below link they are doing this with the standard font class. is there a way to do the same with a custom class instead of the font class. http://www.eggheadcafe.com/forumpost.aspx?redirect=forumpostsubmission&topicid=2&forumpostid=10158840#Post10158840[^] an example of my custom class is below: public class CustomClass { CustomClassSubProperty m_ccsp = new CustomClassSubProperty(); public CustomClassSubProperty M_ccsp { get { return m_ccsp ; } set { m_ccsp = value; } } } public class CustomClassSubProperty { string m_s = "Hide Me"; public string S { get { return m_s; } set { m_s = value; } } string m_a = "Show Me"; public string A { get { return m_a; } set { m_a = value; } } } Is there a way I can hide the sub property S in the property grid at runtime? Thanks for the help.
-
I am using the property grid and have it doing most things in need. the property grid is loaded with custom class and i have used ExpandableObjectConverter to display subproperties. I would like to know if there is a way to hide one or more of these subproperties at runtime. In the below link they are doing this with the standard font class. is there a way to do the same with a custom class instead of the font class. http://www.eggheadcafe.com/forumpost.aspx?redirect=forumpostsubmission&topicid=2&forumpostid=10158840#Post10158840[^] an example of my custom class is below: public class CustomClass { CustomClassSubProperty m_ccsp = new CustomClassSubProperty(); public CustomClassSubProperty M_ccsp { get { return m_ccsp ; } set { m_ccsp = value; } } } public class CustomClassSubProperty { string m_s = "Hide Me"; public string S { get { return m_s; } set { m_s = value; } } string m_a = "Show Me"; public string A { get { return m_a; } set { m_a = value; } } } Is there a way I can hide the sub property S in the property grid at runtime? Thanks for the help.
Yes - Hiding inherited properties[^] works the same for your own ones.
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
-
Yes - Hiding inherited properties[^] works the same for your own ones.
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
yeah I can do that but is there anyway i can hide it at runtime. so i can show it if a certain condition and hide not.