For some reason, we have to upgrade our project's .net framework's version from 3.5 to 4.5. But the Telerik.Web.UI.dll in our project is still 2009.3.1314.35. And the bugs happened.
All inputs width are all 100% even if you set a width to them. For example you can see the html after the RadNumberTextBox rendered.
As you see, there are some width:100% in code, But actually, I have set a width 80px to it.
I used reflector to see the code, and found this. I guess this bug is caused by the code "this.Browser.IsBrowser("Gecko")", can you help me fix that, And build a new dll for me, because I don't have the source code,
and it is hard for us to upgrade the telerik controls to a new version. Thanks.
All inputs width are all 100% even if you set a width to them. For example you can see the html after the RadNumberTextBox rendered.
<
table
cellpadding
=
"0"
cellspacing
=
"0"
class
=
"riTable"
style
=
"border-width:0;border-collapse:collapse;width:100%;"
>
<
tbody
><
tr
>
<
td
class
=
"riCell"
style
=
"width:100%;white-space:nowrap;"
><
input
type
=
"text"
value
=
"1"
id
=
"ctl01_ContentPlaceHolder1_ProductDetail1_rptGoods_ctl00_rntbAmount_text"
name
=
"ctl01_ContentPlaceHolder1_ProductDetail1_rptGoods_ctl00_rntbAmount_text"
class
=
"riTextBox riEnabled"
style
=
"width: 100%;"
maxlength
=
"524288"
><
input
style
=
"visibility:hidden;float:right;margin:-18px 0 0 -1px;width:1px;height:1px;overflow:hidden;border:0;padding:0;"
id
=
"ctl01_ContentPlaceHolder1_ProductDetail1_rptGoods_ctl00_rntbAmount"
class
=
"rdfd_"
value
=
"1"
type
=
"text"
><
input
style
=
"visibility:hidden;float:right;margin:-18px 0 0 -1px;width:1px;height:1px;overflow:hidden;border:0;padding:0;"
id
=
"ctl01_ContentPlaceHolder1_ProductDetail1_rptGoods_ctl00_rntbAmount_Value"
class
=
"rdfd_"
name
=
"ctl01$ContentPlaceHolder1$ProductDetail1$rptGoods$ctl00$rntbAmount"
value
=
"1"
type
=
"text"
></
td
><
td
class
=
"riSpin"
><
a
class
=
"riUp"
href
=
"javascript:void(0)"
id
=
"ctl01_ContentPlaceHolder1_ProductDetail1_rptGoods_ctl00_rntbAmount_SpinUpButton"
><
span
>Spin Up</
span
></
a
><
a
class
=
"riDown"
href
=
"javascript:void(0)"
id
=
"ctl01_ContentPlaceHolder1_ProductDetail1_rptGoods_ctl00_rntbAmount_SpinDownButton"
><
span
>Spin Down</
span
></
a
></
td
>
</
tr
>
</
tbody
></
table
>
As you see, there are some width:100% in code, But actually, I have set a width 80px to it.
I used reflector to see the code, and found this. I guess this bug is caused by the code "this.Browser.IsBrowser("Gecko")", can you help me fix that, And build a new dll for me, because I don't have the source code,
and it is hard for us to upgrade the telerik controls to a new version. Thanks.
protected override void RenderContents(HtmlTextWriter writer)
{
if (this.isOnlyInputRendered())
{
this.RenderInputElements(writer);
}
else
{
writer.AddAttribute("cellpadding", "0");
writer.AddAttribute("cellspacing", "0");
writer.AddStyleAttribute(HtmlTextWriterStyle.BorderWidth, "0");
writer.AddStyleAttribute(HtmlTextWriterStyle.BorderCollapse, "collapse");
if ((base.DesignMode || !this.Browser.IsBrowser("Gecko")) || ((this.Browser.IsBrowser("Gecko") && !this.setWidth.IsEmpty) && (this.setWidth.Type == UnitType.Percentage)))
{
writer.AddStyleAttribute("width", "100%");
}
else
{
writer.AddStyleAttribute("width", this.setWidth.IsEmpty ? this.defaultWidth.ToString() : this.setWidth.ToString());
}
writer.AddAttribute(HtmlTextWriterAttribute.Class, "riTable");
writer.RenderBeginTag(HtmlTextWriterTag.Table);
writer.RenderBeginTag(HtmlTextWriterTag.Tr);
if (this.Label != "")
{
writer.RenderBeginTag(HtmlTextWriterTag.Td);
this.RenderLabel(writer, this.ClientID + "_text");
writer.RenderEndTag();
}
if (this.ButtonsPosition == InputButtonsPosition.Left)
{
base.RenderContents(writer);
}
writer.AddAttribute("class", "riCell");
writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
if (!base.DesignMode && !this.Browser.IsBrowser("Safari"))
{
writer.AddStyleAttribute("white-space", "nowrap");
}
if (!base.DesignMode && this.Browser.IsBrowser("Safari"))
{
writer.AddStyleAttribute("white-space", "normal");
}
writer.RenderBeginTag(HtmlTextWriterTag.Td);
this.RenderInputElements(writer);
writer.RenderEndTag();
if (this.ButtonsPosition == InputButtonsPosition.Right)
{
base.RenderContents(writer);
}
writer.RenderEndTag();
writer.RenderEndTag();
}
}