public void DeleteItemTableSubItem(AccountingInformation backGroundInformation) { ListViewItem foundItem = MyListView.FindItemWithText(backGroundInformation.currentItemName); if (null == foundItem) { MessageBox.Show("backGroundInformation have no such item"); } else { MyListView.Items.Remove(foundItem); textBox_item_name.Text = ""; textBox_item_price.Text = ""; } }
public void ModifyItemTableNameAndPriceGui(AccountingInformation backGroundInformation) { ListViewItem foundItem = MyListView.FindItemWithText(backGroundInformation.currentItemName); if (foundItem != null) { //int a = ItemsControl.getListIndex(textBox_item.Text); MyListView.Items.Remove(foundItem); } ListViewItem item = new ListViewItem(); item.SubItems.Clear(); item.SubItems[0].Text = backGroundInformation.currentItemName; item.SubItems.Add(backGroundInformation.currentItemPrice); MyListView.Items.Add(item); }