private void FillTabStripAlignment(RadDropDownList combo, TabStripAlignment selected) { combo.BeginUpdate(); combo.Items.Clear(); int counter = 0; int selectedIndex = -1; foreach (TabStripAlignment align in Enum.GetValues(typeof(TabStripAlignment))) { RadListDataItem item = new RadListDataItem(align.ToString()); item.Value = align; combo.Items.Add(item); if (align == selected) { selectedIndex = counter; } counter++; } combo.SelectedIndex = selectedIndex; combo.EndUpdate(); }
private static void RebuildComboBoxItems(RadDropDownList comboBox, int count) { comboBox.BeginUpdate(); comboBox.Items.Clear(); for (int i = 0; i < count; i++) { comboBox.Items.Add(new RadListDataItem(string.Format("Row {0}", i + 1))); } comboBox.Items.Add(new RadListDataItem("New Row")); comboBox.SelectedIndex = count - 1; comboBox.EndUpdate(); }