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

Remove Default Width

5 Answers 71 Views
Input
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 22 May 2013, 09:16 PM
For those wanting to remove the default width on RadTextBoxes (or in my case RadNumericTextBoxes) you've probably come across this outdated solution. Here's the updated method that I used to solve this problem:
function RemoveWidth(sender, args) {
    sender.get_wrapperElement().style.removeProperty("width");
}

Attach this to the client OnLoad event and you should be good to go.

(I'll leave it up to Telerik to update the Code Library and/or correct my solution.)

5 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 24 May 2013, 10:59 AM
Hi Matthew,

If you just remove the width of the wrapper element it will be applied again when the input change it's state(enabled,hovered,error state etc.) So I would suggest to use the code from our Code Library.

Regards,
Vasil
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Matthew
Top achievements
Rank 1
answered on 24 May 2013, 03:23 PM
I haven't had any issues with state changes. I have skinned the button, but I don't think I changed anything for error state, and that doesn't mess it up. In case I wasn't clear, I tried the solution in the Code Library--it does nothing. Rather literally, too. I stepped through with Firebug and the originalTextBoxCssText is an empty string before I even try to strip away the width.
0
Vasil
Telerik team
answered on 27 May 2013, 06:22 AM
Hello,

It is used in IE7 to correct some browser problems, actually if you use only modern browsers, the property will not be used.

Regards,
Vasil
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Matthew
Top achievements
Rank 1
answered on 28 May 2013, 02:38 PM
Thank you. Yes, IE7 is not one of my target browsers. So looking at the Code Library sample I linked to above, is the javascript solution current? It wasn't working for me, so I'm inclined to think it's out of date. Could you double-check that, please? Thanks.
0
Vasil
Telerik team
answered on 31 May 2013, 07:24 AM
Hi Matthew,

Thank you for your feedback, we will double check the Code Library and correct it if needed.

Regards,
Vasil
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Input
Asked by
Matthew
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Matthew
Top achievements
Rank 1
Share this question
or