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

RadComboBox Items not highlighting blue when changed the back color

2 Answers 140 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dan Harvey
Top achievements
Rank 2
Dan Harvey asked on 23 Mar 2012, 06:39 PM
Hello,

When binding a combobox I am setting every other item's BackColor to "Gainsboro".  However, when I click the combobox and hover the items in the combobox the items backcolor I changed aren't highlighing blue anymore

for(var i=0; i < 10;i++)
 {
     // bind result to control
     var comboBoxItem = new RadComboBoxItem(i.ToString(), i.ToString());
     // add alternating row color
     if (i % 2 == 0)
         comboBoxItem.BackColor = Color.Gainsboro;
     comboBox.Items.Add(comboBoxItem);
 }

Attached is a picture of what Im seeing:

I would like all items to Highlight blue.

Thanks,

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 26 Mar 2012, 06:41 AM
Hello,

I have tried the following method to change the background-color of RadComboBoxItem on mouse hover and it is working for me.
C#:
for (var i = 0; i < 10; i++)
 {
  var comboBoxItem = new RadComboBoxItem(i.ToString(), i.ToString());
  if (i % 2 == 0)
  comboBoxItem.BackColor = Color.Gainsboro;
  comboBox.Items.Add(comboBoxItem);
  comboBoxItem.CssClass = "itemcss";
 }
CSS:
<style type="text/css">
 .itemcss:hover
  {
   background-color:Blue !important;
  }
</style>

Thanks,
-Shinu.
0
Dan Harvey
Top achievements
Rank 2
answered on 26 Mar 2012, 01:22 PM
Thanks!! this was what I was looking for!
Tags
ComboBox
Asked by
Dan Harvey
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 1
Dan Harvey
Top achievements
Rank 2
Share this question
or