Hello Marco,
I guess that you are trying to show only properties (and their
subproperties) that are under a particular category. Unfortunately you
are not using the right tool to do that. Your subproperties get
filtered because they don't have the CategoryAttribute you supply. A
better way would be to use a TypeDescriptor or TypeConverter for your
class that would filter out any toplevel property that is not under
the category (it would publish only the PropertyDescriptors that have
the CategoryAttribute).
Best regards,
Nicolas Cadilhac @ VisualHint (
http://www.visualhint.com)
Home of Smart FieldPackEditor.Net / DateTimePicker replacement (http://
www.visualhint.com/index.php/fieldpackeditor)
Home of Smart PropertyGrid for .Net and MFC (
http://www.visualhint.com/
index.php/propertygrid)
Microsoft PropertyGrid Resource List -
http://www.propertygridresourcelist.com
On Oct 12, 8:45 am, Marco Segurini <marcosegur...@gmail.comwrote:
Hi All,
I have a form containing only a PropertyGrid that I use to modify an
instance of the following class:
class MyClass
{
Point _point = new Point();
[CategoryAttribute("Drawing")]
public Point MyPoint
{
get { return _point; }
set { _point = value; }
}
}
All works fine.
Now if I add
this._propertyGrid.BrowsableAttributes
= new AttributeCollection(
new Attribute[] { new CategoryAttribute("Drawing") });
to the form's initialization code: what happens is that "MyPoint"
property does not more expand in the PropertyGrid.
Is there a way to apply the CategoryAttribute only to the first level of
properties?
TIA.
Marco.