Filter elements in PropertyGrid
In System.Windows.Forms there are a PropertyGrid that displays properties of an attached object. Let's say MyTextBox : TextBox
.
Now, I would like to display on it some MyTextBox properties, say only Size
, Location
and my custom property Date
.
More that than, I would like to be able to change the real property names, say "Dimension", "Location" and "Starting Date".
I saw two projects on this subject : first and second, but first does not work well(for browsabl开发者_开发问答e properties), and the second seems to add an event for each property changes, this is not acceptable.
You should be able to hide them with a [Browsable(false)]
attribute. If you want to change the name, you need to write your own TypeDescriptor as seen here
精彩评论