public void SetListItemsTexts(string[] texts) { List_TL.Controls.Clear(); foreach (var text in texts) { RemovableDropDownControl newC = new RemovableDropDownControl(); newC.SetMembers(_members); newC.Value = text; newC.Remove += OnRemoveItemFromList; newC.ChangeValue += OnItemValueChanged; List_TL.Controls.Add(newC); _removableDropDownControls.Add(newC); } }
public void AddNewItemToList(string itemName) { if (!AddItem(itemName)) { return; } RemovableDropDownControl newC = new RemovableDropDownControl(); newC.SetMembers(_members); newC.Value = itemName; newC.Remove += OnRemoveItemFromList; newC.ChangeValue += OnItemValueChanged; List_TL.Controls.Add(newC); _removableDropDownControls.Add(newC); }