I am building a control that inherits fron Control. (I don't want all of the properties of WebControl). I do however need a width property. Here is the code I have put into my control.
[Bindable(false),
Category("Appearance"),
DefaultValue(""),
Description("Width for the control."),
TypeConverter(typeof(System.Web.UI.WebControls.UnitConverter))]
public Unit ControlWidth
{
get
{
return (this.ViewState["_ControlWidth"] == null) ? Unit.Empty : (Unit)this.ViewState["_TabsPerRow"];
}
set
{
this.ViewState["_ControlWidth"]=value;
}
}
When in visual Studio if I try to set the property from the property window to say "100%" or "100px" it throws an error of it being an invalid type. What am I missing here? Any help would be greatly appreciated.
Thanks,