This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I have class derived from Control but I don't want all properties to be shown in PropertyGrid, only some of them (mainly those I created, but probably some of those from parent class). Is this possible somehow? Thanks in advance |
|
|
You can achieve this using filtering. The following code is not tested (and omits error handling etc.) but should provide a starting point: grid.BindingView.DefaultView.Filter = delegate(object o) Obviously you can supply your own logic in the filter, e.g. to include certain properties even when they are inherited. (By the way, if there is a property you define yourself which you want to hide, you don't need to use filtering for that, you can just apply the Browsable(false) attribute.) |
|
|
Thanks, Ivan, this helps as a concept. I'll have to see how to deal with attached properties which are not filtered this way. |
|