RadComboBox Items not highlighting blue when changed the back color

3 posts, 0 answers
  1. Dan Harvey
    Dan Harvey avatar
    67 posts
    Member since:
    Jul 2008

    Posted 23 Mar 2012 Link to this post

    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. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 26 Mar 2012 Link to this post

    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.
  3. Dan Harvey
    Dan Harvey avatar
    67 posts
    Member since:
    Jul 2008

    Posted 26 Mar 2012 Link to this post

    Thanks!! this was what I was looking for!
Back to Top