I have an ObservableCollection bound to a listbox like this:
string[] selection = comboEmail.GetItemText(comboEmail.SelectedItem).Split(',');
Employee add = new Employee(Convert.ToInt32(selection[0]), selection[1], selection[2], selection[3]);
displayEmp.Add(add);
listEmail.DataSource = displayEmp;
It adds the data to the listbox(listEmail), however, how do I update it after removal. This is what I've tried so far:
int indexRemoval = listEmail.SelectedIndex;
displayEmp.RemoveAt(indexRemoval);
listEmail.DataSource = displayEmp;
//listEmail.Refresh();
but it doesn't work. How would I update the list after a user as clicked the remove button?