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

Custom CSS getting applied to all comboxes in the page.

6 Answers 75 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Vishnu
Top achievements
Rank 1
Vishnu asked on 11 Jun 2014, 05:31 AM
Hi

There are two radcomboboxes in the ASPX with MetroTouch skin and I want to add some different custom styles to the radcomboboxes as shown below.

<telerik:RadComboBox ID="rcbModelName" runat="server" Skin="MetroTouch" Width="100%"
EmptyMessage="Select Model" Height="120px">
</telerik:RadComboBox>
<telerik:RadComboBox ID="rcbColor" runat="server" Skin="MetroTouch" Width="100%"
EmptyMessage="Select Color" Height="120px">
</telerik:RadComboBox>
 
.RadComboBox_MetroTouch .rcbInputCell
{
      border: 1px solid Gray !important;
      background: #FFFFFF url("../Images/Icon1.png") no-repeat 3% 55% !important;
      text-indent: 12%;
}

When I apply the above style, its getting applied to all the radcomboboxes in the page with MetroTouch skin.

So how can I apply the above CSS using the ID so that it will be applied to the corresponding radcombobox only and similarly I can provide some other custom styles to the other combobox as well.

Thanks,
Vishnu.

6 Answers, 1 is accepted

Sort by
0
Magdalena
Telerik team
answered on 11 Jun 2014, 10:59 AM
Hello Vishnu,

You can use a selector #rcbModelName .rcbInputCell. So the rule will be
#rcbModelName .rcbInputCell {
    border: 1px solid Gray !important;
    background: #FFFFFF url("../Images/Icon1.png") no-repeat 3% 55% !important;
    text-indent: 12%;
}

Regards,
Magdalena
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Boyan Dimitrov
Telerik team
answered on 11 Jun 2014, 11:30 AM
Hello Vishnu,

You can use a selector #rcbModelName .rcbInputCell. So the rule will be
#rcbModelName .rcbInputCell {
    border: 1px solid Gray !important;
    background: #FFFFFF url("../Images/Icon1.png") no-repeat 3% 55% !important;
    text-indent: 12%;
}

Do not hesitate to contact us if you have other questions.


Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Vishnu
Top achievements
Rank 1
answered on 11 Jun 2014, 01:38 PM
Hi Magdalena, Boyan,

Thanks for your reply.

The above CSS works for a radcombobox if it is inside a normal aspx page. But I am having a Master Page - Content Page setup and all those comboboxes are inside the content page where the above solution you provided didnt work.

Please provide a solution for the controls in content page.

Thanks,
Vishnu.
 
0
Vishnu
Top achievements
Rank 1
answered on 13 Jun 2014, 04:24 AM
Hi Admin,

Please provide a solution for the above mentioned scenario.

Thanks.
0
Accepted
Magdalena
Telerik team
answered on 13 Jun 2014, 10:36 AM
Hi Vishnu,

The "ID" property in aspx is not applied as an "id" property to HTML by using master pages because of avoiding a possible conflict comes form duplicate id-s on one page. For that reason you can use the "CssClass" property. Please, find a sample project with master page in the attachment.

Regards,
Magdalena
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Vishnu
Top achievements
Rank 1
answered on 13 Jun 2014, 11:16 AM
Hi Magdalena,

Thanks for the complete solution.

Vishnu.
Tags
ComboBox
Asked by
Vishnu
Top achievements
Rank 1
Answers by
Magdalena
Telerik team
Boyan Dimitrov
Telerik team
Vishnu
Top achievements
Rank 1
Share this question
or