We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Property Editor

I have a question that is related to the property editor. We have a derived symbol class with a dynamic number of custom properties. We are using a collection to hold the properties since we don''t know the total number of custom properties until the symbol instance is created. We don''t want to display the custom properties as a collection (i.e. we don''t want the collection editor button or an expandable tree) Instead, we would like to list the properties as if they were all separate properties, not related to a collection. I realize that this is really a .NET question relating to the property grid but I was hoping someone out there might be able to help us or point us in the right direction. Thanks, Chris

1 Reply

PS Prakash S Syncfusion Team November 10, 2005 04:04 PM UTC

Hi Chris, You can selectively expose the properties of an object by using a TypeDescriptor for the class. The use of a TypeDescriptor to filter out the properties of an Essential Diagram Symbol is demonstrated in the QuickStart\CustomSymbol sample that ships with the product. Please refer to the MySymbol.cs file in that sample to view the symbol''s TypeDescriptor. In your case, you can simply hide the collection property from the PropertyEditor by using an ''EditorBrowsableAttribute'' with the ''EditorBrowsableState.Never'' state on the particular property. You can then use the class TypeDescriptor''s GetProperties() override to iterate through the particular collection property and expose the collection properties as top-level properties of the type. Thanks, Prakash Surendra Syncfusion Inc.,

Loader.
Live Chat Icon For mobile
Up arrow icon