Remove Default Width

6 posts, 0 answers
  1. Matthew
    Matthew avatar
    51 posts
    Member since:
    Oct 2012

    Posted 22 May 2013 Link to this post

    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.)
  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 24 May 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Matthew
    Matthew avatar
    51 posts
    Member since:
    Oct 2012

    Posted 24 May 2013 Link to this post

    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.
  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 27 May 2013 Link to this post

    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.
  6. Matthew
    Matthew avatar
    51 posts
    Member since:
    Oct 2012

    Posted 28 May 2013 Link to this post

    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.
  7. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 31 May 2013 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017