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

Change color of selected items in combobox

1 Answer 170 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Aneesh
Top achievements
Rank 1
Aneesh asked on 07 Jun 2012, 07:44 AM
I have a radcombobox with checkboxes. I need to change the color of the selected items of the combobox on selecting a radio button.

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 07 Jun 2012, 08:42 AM
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.
Tags
ComboBox
Asked by
Aneesh
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or