How exactly do you set the width of a numerictextbox?

3 posts, 0 answers
  1. -DJ-
    -DJ- avatar
    263 posts
    Member since:
    Oct 2004

    Posted 08 May 2009 Link to this post

    Hi guys,

    I've been trying to set the width of a numerictextbox for about two hours now.
    Most of my style elements don't even show up in the page. If I set ShowSpinButtons="True" the width is applied to the textbox itself it seems, but the label or something else is still too wide.

    If I set ShowSpinButtons="False" the width is totally ignored.

    I found this in some thread:
        <style type="text/css">
        .radLabelCss_Default
        {
            display: inline-block;
            width: 10px;        
        }
    </style>
    It has no effect.

    This is my numeric textbox definition:



    <telerik:RadNumericTextBox ID="txtReaderHomeTeamScore" MinValue="0" MaxValue="99" MaxLength="2" Label="" NumberFormat-DecimalDigits="0" ShowSpinButtons="true" style="width: 40px; text-align:right" runat="server" />

    Regards,
    -DJ-
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 May 2009 Link to this post

    Hi,

    Try out the following CSS and see whether you got it working.

    CSS:
     
    <style type="text/css">  
    html body .RadInput_Default .riTextBox,  
    html body .RadInputMgr_Default  
    {  
         width:10px !important;  
    }  
    </style> 

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. -DJ-
    -DJ- avatar
    263 posts
    Member since:
    Oct 2004

    Posted 08 May 2009 Link to this post

    Thanks Princy.

    In the end it seems there is a div-wrapper around the table that has a default value of 125px, which is probably creating the extra space.
    I managed to solve this by using:
    RadInput_Default
    {
    width: xx;
    }

    Thanks for your help,
    -DJ-
Back to Top