0

I've already had success exposing a collection of items in the vb.net designer using DesignerSerializationVisibility(Content). Now I have a new twist. The items in my collection for a certain custom control are immutable--i.e. items can neither be added nor removed. All I want is to expose the items of my collection in the properties panel of the designer so that a developer can tweak the individual properties of each item in the predefined collection of items.

When I tried DesignerSerializationVisibility(Content) it allows the developer to manage the items but rather than editing the existing items it attempts to re-add the items to the collection, which causes key collisions.

As a result I figured it might make sense to expose each item of the collection as its own property. I used DesignerSerializationVisiblity(Visible) and (Content) and both just display the type name in the properties window but the object it exposes is not visible in a way that it can have its properties manipulated.

Am I missing something or can this not be done? I read somewhere about using a TypeConverter. Is this right?

Mario
  • 6,572
  • 3
  • 42
  • 74

1 Answers1

0

If I understand your Question correctly, you want to change a property to expandable property that has several sub-property.

If I understand properly, you must create a class that is derived from ExpandableObjectConverter. And use this class with TypeConverterAttribute for your property or that class that is related with your property.

For more information, please see my question that its link is offered in below:

Hide ellipsis (…) button of expandable property like “…” button of font property in the property grid

Community
  • 1
  • 1
MRS1367
  • 1,053
  • 1
  • 14
  • 40