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

Using the CSS class to set the RadInput width, when followed by other controls

3 Answers 78 Views
Input
This is a migrated thread and some comments may be shown as answers.
Michel
Top achievements
Rank 1
Michel asked on 30 Nov 2009, 06:14 AM

I tried following the instructions here http://www.telerik.com/help/aspnet-ajax/input_appearancewidth.html (Using the CSS class to set the width). However, when ShowButton = true, ShowSpinButtons = true or Label = true, controls that are immediatly after the RadInput seem to remain aligned with the default 125px and not the value specified by the CSS.

Below is such an example, where a RadNumericTextBox has both a label and spin buttons, and is followed by a RequiredFieldValidator.

<html xmlns="http://www.w3.org/1999/xhtml">  
    <head id="Head1" runat="server">  
        <title></title>  
        <style type="text/css">  
            /*when using label or buttons*/  
            .RadInput_Default,  
            .RadInput_Default table  
            {  
                width: 250px !important;  
            }  
            /*else*/  
            .RadInput_Default .riTextBox  
            {  
                width: 250px  !important ;  
            }  
        </style> 
    </head> 
    <body> 
        <form id="form1" runat="server">  
            <asp:ScriptManager ID="ScriptManager1" runat="server" />    
            <tlk:RadNumericTextBox id="RadNumericTextBox1" runat="server" Label="Test Label: " ShowSpinButtons="true" /> 
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="RadNumericTextBox1" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator> 
            <br /> 
            <asp:Button ID="Button1" runat="server" Text="Button" /> 
        </form> 
    </body>   
</html> 

Any help to solve this issue would be appreciated.

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 30 Nov 2009, 07:52 AM
Hi Michel,

You should not use the two CSS rules at the same time, as suggested by the CSS comments. Please remove the second one.

Kind regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Michel
Top achievements
Rank 1
answered on 30 Nov 2009, 08:05 AM
Thanks for the quick response.

It wasn't that clear from the comments that we need to use only one of the two. (I though the comments were simply indicating the case where each entry had an effect.)

If I have RadInputs with label or buttons and others without, I guess that I will create two different class selectors for each senario.

Michel
0
Dimo
Telerik team
answered on 30 Nov 2009, 08:13 AM
Hello Michel,

Yes, you will need different selectors, for example you can use CSS classes of other elements on the page, which wrap the two types of textboxes.

Kind regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Input
Asked by
Michel
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Michel
Top achievements
Rank 1
Share this question
or