This is a migrated thread and some comments may be shown as answers.

Dynamic RadTextBox issue when enter text

2 Answers 118 Views
Input
This is a migrated thread and some comments may be shown as answers.
Harry
Top achievements
Rank 1
Harry asked on 18 Nov 2009, 07:53 AM
hello...
i m using dynamic Rad text box...

protected void Page_Init(object sender, EventArgs e)

{

for (Int32 j = 0; j < 2; j++)

{

TableRow tr = new TableRow();

for (Int32 i = 0; i < 2; i++)

{

HimaniTextBox txtbox = new HimaniTextBox();

txtbox.ID = "TextBox" + i;

txtbox.CssClass = "txtstyle1";

TableCell tc = new TableCell();

tc.Style.Add("Width", "50%");

tc.Controls.Add(txtbox);

tr.Controls.Add(tc);

}

Table1.Controls.Add(tr);

}

}
STYLE SHEET Is

 

.txtstyle1

 

 

{

width:99% !important;

}
when i enter  text in this textbox its  size increase according enter text...
for clear vision plz see  attached file

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 18 Nov 2009, 01:49 PM
Hello Harry,

Please don't set percentage RadTextBox widths like that. Use the control's property and the issue will not occur.

In addition, it is recommended to set a table-layout:fixed CSS style to the table in your case. This is because the RadTextBoxes recalculate their width on the client and as a result, the parent <table> may expand unexpectedly.

Sincerely yours,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Harry
Top achievements
Rank 1
answered on 20 Nov 2009, 06:36 AM
Thanks alot
Tags
Input
Asked by
Harry
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Harry
Top achievements
Rank 1
Share this question
or