All I’m really trying to do is populate three different comboboxes with the same item. When this code executes below only one combobox is getting the values. Any help is welcomed. Thanks!
for (int i = 0; i < 100; i++)
{
RadComboBoxItem li = new RadComboBoxItem();
li.Text = i.ToString();
li.Value = i.ToString();
InputPairThousandValueComboBox.Items.Add(li);
InputUsertThousdandValueComboBox.Items.Add(li);
InputCurrentlyListedThousdandComboBox.Items.Add(li);
}
I couldn’t find anything in the Telerik docs that says this explicitly, but it appears a single instance of a
RadComboBoxItemcan only be contained in a singleRadComboBox; you can’t share aRadComboBoxItembetween controls.The docs do hint to this: the
RadComboBoxItemhas an ‘owner’ property that is a reference to theRadComboBoxthat contains the item (implying that there can be only 1 owner)Under the covers, the second & third
Add(...)calls most likely first remove the item from the combo box its already in.So, you’ll have to create a separate
RadComboBoxItemfor eachRadComboBox. Here’s one way you could do it using theRadComboBoxItemconstructor that takes the text and value as arguments.