J
Jeremy Chapman
I was looking at the HtmlTable control, and noticed that the CellPadding and
CellSpacing properties are of type integer, yet in the property grid you can
clear the values. I'm trying to make a property of type int in one of my
controls and when I clear the property in the design time property editor, I
get an error "Property value is not valid." Using reflector I took a look
at the code inside the HtmlTable control and I've pretty much copied it in
my control but it still doesn't work. Has anyone tried this?
This is the asp.net code:
[WebCategory("Appearance"),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
DefaultValue("")]
public int CellPadding
{
get
{
string text1 = base.Attributes["cellpadding"];
if (text1 == null)
{
return -1;
}
return int.Parse(text1, CultureInfo.InvariantCulture);
}
set
{
base.Attributes["cellpadding"] =
HtmlControl.MapIntegerAttributeToString(value);
}
}
CellSpacing properties are of type integer, yet in the property grid you can
clear the values. I'm trying to make a property of type int in one of my
controls and when I clear the property in the design time property editor, I
get an error "Property value is not valid." Using reflector I took a look
at the code inside the HtmlTable control and I've pretty much copied it in
my control but it still doesn't work. Has anyone tried this?
This is the asp.net code:
[WebCategory("Appearance"),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
DefaultValue("")]
public int CellPadding
{
get
{
string text1 = base.Attributes["cellpadding"];
if (text1 == null)
{
return -1;
}
return int.Parse(text1, CultureInfo.InvariantCulture);
}
set
{
base.Attributes["cellpadding"] =
HtmlControl.MapIntegerAttributeToString(value);
}
}