Last post Sep 10, 2020 05:45 AM by XuDong Peng
Sep 09, 2020 02:35 PM|mazharul007|LINK
I am trying to clear a radcombox previously selected value based on some condition.
but in my code radComboBox.ClearSelection(); is not working and clearing the previously selected result. What can be the best alternative of ClearSelection(); here to clear my radcombobox's previously selected result?
Sep 10, 2020 05:45 AM|XuDong Peng|LINK
I am afraid that there is not enough environment to test your code. If you use Telerik RadCombobox, you could try to set it as a selection directly after adding an option without clearing the current selection.
RadCombobox can only select one item at a time. If no item is currently selected, then the
Selected property of all items will be False. Setting the Selected property of one item to
True automatically sets the Selected property of all other items in RadComboBox to
//add new Item to RadCombobox
RadComboBoxItem item = new RadComboBoxItem();
item.Text = positionName;
item.Value = positionId;
//set selected option
RadComboBoxItem item = ddlPosition.FindItemByText(positionName);
item.Selected = true;
And the use of this control is different from ordinary ComboBox. Please refer to
this document for more details.
Hope this can help you.