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

Add Item/Value to RCB

1 Answer 29 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Zed
Top achievements
Rank 1
Zed asked on 15 Apr 2013, 10:48 AM
Hello,
  I want the user to be able to add a value to the RadComboBox if it is not there.  Is this possible with the RCB?

Thanks

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 15 Apr 2013, 11:38 AM
Hi,

I guess you need to check if the RadComboBox contain a particular item and If its not present, add that item into the RadCombobox. Please have a look into the following code.

C#:
RadComboBoxItem item1=new RadComboBoxItem("Your Item Text");
item1.Value = "Your Item Value";
if (!RadComboBox.Items.Contains(item1))
{
    RadComboBox.Items.Add(item1);
}

Thanks,
Princy.
Tags
ComboBox
Asked by
Zed
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or