Change color of selected items in combobox

2 posts, 1 answers
  1. Aneesh
    Aneesh avatar
    9 posts
    Member since:
    May 2012

    Posted 07 Jun 2012 Link to this post

    I have a radcombobox with checkboxes. I need to change the color of the selected items of the combobox on selecting a radio button.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 Jun 2012 Link to this post

    Hi Aneesh,

    Try the following code snippet to achieve your scenario.

    C#:
    protected void RadButton1_Click(object sender, EventArgs e)
        {
            foreach (RadComboBoxItem item in RadComboBox1.Items)
            {
                if (item.Checked == true)
                {
                    item.ForeColor = System.Drawing.Color.Red;
                }
            }
        }

    Hope this helps.

    Thanks,
    Princy.
Back to Top