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

How to set CSS for particular radcombox id

1 Answer 156 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dhamodharan
Top achievements
Rank 1
Dhamodharan asked on 07 May 2012, 11:55 AM
Hi,

I want to use this style for one particular radcombobox.

 div.RadComboBox table td.rcbInputCell { padding-left: 0; padding-right: 4px; }

        div.RadComboBox table td.rcbInputCell .rcbInput { text-align: right; }

        div.RadComboBoxDropDown .rcbItem,
        div.RadComboBoxDropDown .rcbHovered,
        div.RadComboBoxDropDown .rcbDisabled,
        div.RadComboBoxDropDown .rcbLoading
        {
            padding: 4px 4px 4px 20px;
            text-align: right;
        }

but this code affect all the combobox in a page. let me know if you have any solutions,

Thanks in advance,
Dhamu.

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 10 May 2012, 10:58 AM
Hello Dhamu,

You can use the following css classes in order to style only one RadCombobox:
<style type="text/css">
       div.new table td.rcbInputCell
       {
           padding-left: 0;
           padding-right: 4px;
       }
        
       div.new table td.rcbInputCell .rcbInput
       {
           text-align: right;
       }
        
       div#RadComboBox1_DropDown .rcbItem,
        div#RadComboBox1_DropDown .rcbHovered,
         div#RadComboBox1_DropDown .rcbLoading,
          div#RadComboBox1_DropDown .rcbDisabled
       {
           padding: 4px 4px 4px 20px;
           text-align: right;
       }
   </style>

markup:
<telerik:RadComboBox ID="RadComboBox1" runat="server" CssClass="new">
         <Items>
             <telerik:RadComboBoxItem Text="test 1" Value="0" />
             <telerik:RadComboBoxItem Text="test 2" Value="1" />
             <telerik:RadComboBoxItem Text="test 3" Value="2" />
         </Items>
     </telerik:RadComboBox>
 </div>
 <br />
 <br />
 <telerik:RadComboBox ID="RadComboBox2" runat="server">
     <Items>
         <telerik:RadComboBoxItem Text="test 1" />
         <telerik:RadComboBoxItem Text="test 2" />
         <telerik:RadComboBoxItem Text="test 3" />
     </Items>
 </telerik:RadComboBox>

Regards,
Kate
the Telerik team
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
ComboBox
Asked by
Dhamodharan
Top achievements
Rank 1
Answers by
Kate
Telerik team
Share this question
or