Property grid only show some category

强颜欢笑 提交于 2019-12-09 19:48:28

问题


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#


回答1:


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

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

And (hopefully) it should work.



来源:https://stackoverflow.com/questions/706871/property-grid-only-show-some-category

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!