属性网格仅显示某些类别

我有一个PropertyGrid,用于具有以下属性类别的对象:Style,Calcul和Misc

我想要的只是向用户显示Calcul类别,但我不想使用browsable属性,因为我希望所有这些属性在Visual Studio中可见。

所以,我需要的是一个代码内的解决方案。

我使用.Net 3.5 c#

PropertyGrid有一个属性 – BrowsableAttributes ; 为此分配您的类别:

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

并且(希望)它应该工作。