views:

311

answers:

1

I got a PropertyGrid that is use on an object that have the following property category : Style, Calcul and Misc

What I want is to only show to the user the Calcul category, but I don't want to use the browsable attribute because I want all these property to be visible in Visual studio.

So, what I need, is an in-code solution.

I use .Net 3.5 c#

+2  A: 

PropertyGrid has a property - BrowsableAttributes; assign this your categories:

        propGrid.BrowsableAttributes = new AttributeCollection(
            new CategoryAttribute("Calcul"));

And (hopefully) it should work.

Marc Gravell
Work great! thanks for this quick answer!
Melursus