protected void grdReceiptItem_RowDeleting(object sender, GridViewDeleteEventArgs e) { // // Recalcula o total e Remove a linha da lista em memória // CalculateTotal(-GetReceiptItemTotalValue(ReceiptItems[e.RowIndex], -1)); ReceiptItems.RemoveAt(e.RowIndex); // // Atualiza a grid já sem o item removido // BindReceiptItems(); }
public void RemoveReceiptItem(int ReceiptItemID) { int i = 0; int index = 0; foreach (ReceiptItem ri in ReceiptItems) { if (ri.ReceiptItemID == ReceiptItemID) { index = i; break; } i++; } ReceiptItems.RemoveAt(index); }