I have a combo box populated with a list of objects. Selecting an item in the box fills text fields with info where I can do my CRUDS functions of it. My code works except trying to refresh my combo after the CRUD. Here is my code.
am is a reference to my author manager class which contains my sql delete code. if i close and open my form it does remove my person, but i want my combo to update automatic with my populatelist method, which it is not doing.
private void Author_Load(object sender, EventArgs e) { am = AuthorManager.Instance; populateList(); } private void populateList() { uxCboAuthors.DataSource = am.getAll(); Console.WriteLine("populate list"); uxCboAuthors.DisplayMember = "FullName"; uxCboAuthors.ValueMember = "Id"; uxCboAuthors.SelectedIndex = 0; uxCboAuthors.Refresh(); } private void uxCmdDelete_Click(object sender, EventArgs e) { a = (AuthorDomain)uxCboAuthors.SelectedItem; int result = 0; result = am.Delete(a); populateList(); clearFields(); }
am is a reference to my author manager class which contains my sql delete code. if i close and open my form it does remove my person, but i want my combo to update automatic with my populatelist method, which it is not doing.
Last edited by a moderator: