Hello, I am using list boxs, my NewLoan button works just fine, adds the loans to the specific lstLoans area, but this code won't delete the selected item, any suggestions?
Here is the code :
Thanks in advance.
Here is the code :
Code:
private void btnDeleteLoan_Click(object sender, RoutedEventArgs e) { Loan SelectedLoan = (Loan) lstLoans.SelectedItem; loans.Remove(SelectedLoan); lstLoans.Items.Remove(SelectedLoan); lstLoans.ItemsSource = loans; lstLoans.Items.Remove(lstLoans.SelectedItem); }
Comment