D
Dr. Guenther Schwarze
Hi,
Sorry for reposting, just thought to give it one more try, as this is a
really annoying problem for us. I will shut up if I still don't get any
replies this time <g>.
I have a component that has a class type property. This class in turn only
consists of about 20 public members which are of a certain enum type. What I
did is to derive a type converter from ExpandableObjectConverter. However,
as I don't want to supply a string representation for the whole class type
property in the property grid (what would this be for 20 members, if not
unreadable anyway?!), I didn't override any of the ConvertTo and ConvertFrom
methods but just have a derived, empty class. See the (shortened) code:
internal class EnumMemberClassConverter : ExpandableObjectConverter
{
}
....
[TypeConverter(typeof(EnumMemberClassConverter))]
public class ClassOfEnums
{
private MyEnum enum1;
private MyEnum enum2;
....
public MyEnum Property1
{
get/set enum1
}
public MyEnum Property2
{
get/set enum2
}
This doesn't seem to work - at design time I'm fine, I habe a property named
ClassOfEnums and can expand it. The sub properties can take on the values of
the enumeration. But the values set here are basically ignored at run time.
Do I _always_ have to provide a string representation? Or is the error
somewhere else? Any hints are very much appreciated.
Thanks very much,
G.
Sorry for reposting, just thought to give it one more try, as this is a
really annoying problem for us. I will shut up if I still don't get any
replies this time <g>.
I have a component that has a class type property. This class in turn only
consists of about 20 public members which are of a certain enum type. What I
did is to derive a type converter from ExpandableObjectConverter. However,
as I don't want to supply a string representation for the whole class type
property in the property grid (what would this be for 20 members, if not
unreadable anyway?!), I didn't override any of the ConvertTo and ConvertFrom
methods but just have a derived, empty class. See the (shortened) code:
internal class EnumMemberClassConverter : ExpandableObjectConverter
{
}
....
[TypeConverter(typeof(EnumMemberClassConverter))]
public class ClassOfEnums
{
private MyEnum enum1;
private MyEnum enum2;
....
public MyEnum Property1
{
get/set enum1
}
public MyEnum Property2
{
get/set enum2
}
This doesn't seem to work - at design time I'm fine, I habe a property named
ClassOfEnums and can expand it. The sub properties can take on the values of
the enumeration. But the values set here are basically ignored at run time.
Do I _always_ have to provide a string representation? Or is the error
somewhere else? Any hints are very much appreciated.
Thanks very much,
G.