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

Width resets in Page Render event

4 Answers 80 Views
Input
This is a migrated thread and some comments may be shown as answers.
Aayam
Top achievements
Rank 1
Aayam asked on 19 May 2010, 01:25 PM
Hi Experts,

While using RadTextBox, RadMaskedTextBox and RadNumericTextBox i noticed that whatever width i set in my aspx page for these control was actually getting reset in PageRender event.

This behavior was noticed when i had a case where i need to render additional item with these control and was trying to shrink their width's and noticed that they were reset to empty unit value.
After debugging we noticed that the width set remains in Width property of the control till PagePreRender event.As soon as we enter the PageRender event it gets reset to empty unit.

Would really like to understand  this behavior of telerik control and appreciate some resolution.

Regards,
Aayam Singh

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 19 May 2010, 03:03 PM
Hi Aayam,

RadInput textboxes consist of several HTML elements, not just a single textbox. That's why the width of the control is normally set via the Width property and may be applied to several elements (depending on the browser and control configuration).

How exactly are you trying to set the width? I suggest you to use the Width property or alternatively, use CSS classes as demonstrated in this help topic:

http://www.telerik.com/help/aspnet-ajax/input_appearancewidth.html

Sincerely yours,
Dimo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Aayam
Top achievements
Rank 1
answered on 20 May 2010, 06:06 AM
Hi Dimo,

We had a look at the link you sent me but it still doesn't solve our purpose.
What we need to do is shrink the set Width of control by configurable percentage in Page Render event.But in this event the Width property is already reset.
I have attached a sample applicaiton in support ticket i raised.
Here is the ID for the same: 311559

I have just placed a simple RadMasked Textbox with width = 100px.
When fetched  this Width in PreRender it works fine but when tried to fetch in in PreRenderComplete  its already reset to empty.

I would like to understand this behavior.

Regards,
Aayam Singh
0
Accepted
Dimo
Telerik team
answered on 20 May 2010, 10:31 AM
Hi Aayam,

In PreRender the value of the Width property of the control is taken and assigned to

EnabledStyle.Width
EmptyMessageStyle.Width
HoveredStyle.Width
FocusedStyle.Width
ReadOnlyStyle.Width
DisabledStyle.Width
InvalidStyle.Width

After that, the ControlStyle is reset.

If you want to manupulate the Width in PreRenderComplete, you have to get/set it from/to the above properties, not Width.

All the best,
Dimo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Aayam
Top achievements
Rank 1
answered on 20 May 2010, 11:09 AM
Hi Dimo,
Thanks for the information.
This would certainly help me.

Regards,
Aayam Singh
Tags
Input
Asked by
Aayam
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Aayam
Top achievements
Rank 1
Share this question
or