Hello everyone! I am trying to dynamically change the value of the Browsable attribute for a property. It works fine when initializing the PropertyGrid, but nothing happens after refreshing.
The System.ComponentModel library in .NET doesn’t let you change a property attribute. You’d have to implement the ICustomTypeDescriptor interface to return the kind of PropertyDescriptor you need.
But… Since the System.ComponentModel system can get quite complicated, the PropertyGrid in Wisej provides additional events and overloadable methods that allow for a certain degree of customization without having to deal with the TypeDescriptors. You can derive from PropertyGrid and overload GetProperties(), it lets you filter the properties to display.
There are 2 properties in the DataItem class. If the first value is false, the second is hidden. If true, then the second property becomes visible.
Thanks for your reply! I’ll try to make changes according to your recommendations. But the same code works fine in a WinForms application.
Please login first to submit.