I have a class Order that contains a set of properties for my OrderControl
control.
Instead of creating separate properties in OrderControl for every property
in Order, I just wanted to make Order a property and then let the user set
any properites within Order via the designer.
But I don't get that plus mark. All I get is a string.
Was wondering ... how to I force the designer to get a plus mark so I can
edit those individual properties?
Eric Cadwell - 29 Jul 2004 16:28 GMT
Try adding the DesignerSerializationVisibility attribute to the Order
property:
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public Order Order
{
get { return order; }
}
HTH;
Eric Cadwell
http://www.origincontrols.com
Mick Doherty - 29 Jul 2004 17:14 GMT
I've just spent the whole day playing around with ExpandableObjectConverter,
so I know how frustrating it can be.
The ExpandableObject Class is simple enough to implement as is getting the
properties to serialize. The tricky part is getting the properties to
deserialize when you reset a property.
I won't go into it all here. If you take a look at my Office Style Menu Code
you should find the solution. Just look at the ItemColors property and
#Region " Expandable Object Convertor "
http://dotnetrix.co.uk/menus.html
You may also want to look at:
{http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/h
tml/vsnetpropbrow.asp?frame=true}

Signature
Mick Doherty
http://dotnetrix.co.uk/nothing.html
> I have a class Order that contains a set of properties for my OrderControl
> control.
[quoted text clipped - 7 lines]
> Was wondering ... how to I force the designer to get a plus mark so I can
> edit those individual properties?
msnews.microsoft.com - 30 Jul 2004 16:02 GMT
OK, thanks both of you for the posts. Here is where I am at. I really just
wanted to expose all the properties an object that I added to a control. The
simplest way to do that is ...
Add this to your property:
[TypeConverter(typeof(IndicationTypeConverter))]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public Indication Indication { ... }
Then create a class like this:
public class IndicationTypeConverter : ExpandableObjectConverter {}
That's it.
There is a whole world of ConvertFrom and ConvertTo ... that are great if
your object needs them, but for me, I just wanted to expose the properties,
and this did the job just fine!
> I have a class Order that contains a set of properties for my OrderControl
> control.
[quoted text clipped - 7 lines]
> Was wondering ... how to I force the designer to get a plus mark so I can
> edit those individual properties?