Posted 14 years ago
by Actipro Software Support
- Cleveland, OH, USA
Hello Larsen,
Yes, this is possible. Your best bet would be to use a custom PropertyGrid.DataFilter. The Filters (Custom) QuickStart shows a category (i.e. ICategoryDataAccessor) can be filtered, but the same concept applies to properties (i.e. IPropertyDataAccessor). You can check the IPropertyDataAccessor.Target property to see if the property is associated with a Button/etc.
Alterntively, you can use a custom PropertyGrid.DataFactory (which derives from our TypeDescriptorFactory). In this case, you are filtering at the data level, while the DataFilter filters at the UI level. You would want to override the GetProperties(object,DataFactoryOptions) method, call the base version, then remove any properties you do not want to show from the list returned.
If you never want to show the filtered properties, then it's probably better to go with a custom DataFactory. If you want to selectively show/hide properties (based on user interaction) then the DataFilter is the better way to go.
Yes, this is possible. Your best bet would be to use a custom PropertyGrid.DataFilter. The Filters (Custom) QuickStart shows a category (i.e. ICategoryDataAccessor) can be filtered, but the same concept applies to properties (i.e. IPropertyDataAccessor). You can check the IPropertyDataAccessor.Target property to see if the property is associated with a Button/etc.
Alterntively, you can use a custom PropertyGrid.DataFactory (which derives from our TypeDescriptorFactory). In this case, you are filtering at the data level, while the DataFilter filters at the UI level. You would want to override the GetProperties(object,DataFactoryOptions) method, call the base version, then remove any properties you do not want to show from the list returned.
If you never want to show the filtered properties, then it's probably better to go with a custom DataFactory. If you want to selectively show/hide properties (based on user interaction) then the DataFilter is the better way to go.
Actipro Software Support