Add Item/Value to RCB

2 posts, 0 answers
  1. Zed
    Zed avatar
    74 posts
    Member since:
    Apr 2008

    Posted 15 Apr 2013 Link to this post

    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
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 15 Apr 2013 Link to this post

    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.
Back to Top