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

How exactly do you set the width of a numerictextbox?

2 Answers 324 Views
Input
This is a migrated thread and some comments may be shown as answers.
-DJ-
Top achievements
Rank 1
-DJ- asked on 08 May 2009, 01:05 PM
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 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 08 May 2009, 01:25 PM
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.
0
-DJ-
Top achievements
Rank 1
answered on 08 May 2009, 02:04 PM
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-
Tags
Input
Asked by
-DJ-
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
-DJ-
Top achievements
Rank 1
Share this question
or