I have a custom control for which there is an enum property. During the design time, the property appears in the IDE, but its not applying to the code when i select one of the value. The rest of the string and integer properties applies to the code.
What could be the problem.
Please post your property getter/setter code for this property including any attributes you have applied to the property. Also post the definition of the enum.
Try changing the DesignerSerializationVisibility attribute to DesignerSerializationVisibility.Visible or leave out this attribute entirely. DesignerSerializationVisibility.Content would be used with complex properties (like Style) where the content of the object
rather than the object itself must be serialized.
cshankar_p
Member
35 Points
8 Posts
Enum properties not applying to the custom control
Jan 23, 2006 10:43 AM|LINK
What could be the problem.
imagemaker
Contributor
2385 Points
466 Posts
Re: Enum properties not applying to the custom control
Jan 23, 2006 01:11 PM|LINK
cshankar_p
Member
35 Points
8 Posts
Re: Enum properties not applying to the custom control
Jan 24, 2006 05:05 AM|LINK
public enum DirectionType
{
LEFT,
RIGHT,
}
The Get and Set properties with attributes used.
[Bindable(false)]
[Category("Appearance")]
[ReadOnly(false)]
[DefaultValue(DirectionType.LEFT)]
[Description("Direction")]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
public DirectionType Direction
{
get
{
if(_direction.ToString()==String.Empty)
return DirectionType.LEFT;
else
return _direction;
}
set
{
_direction = value;
}
}
imagemaker
Contributor
2385 Points
466 Posts
Re: Enum properties not applying to the custom control
Jan 24, 2006 04:40 PM|LINK