private void MarkAsDonePaidPickedUpBttn_Click(object sender, EventArgs e) { int index = ResultGrid.CurrentCell.RowIndex; int ticketId = Convert.ToInt32(ResultGrid.Rows[index].Cells["TicketIdCol"].Value); try { TicketRepository ticketRepo = new TicketRepository(); ticketRepo.MarkTicketAsDonePaidAndPickedUp(ticketId); DataGridViewRow row = ResultGrid.Rows[index]; row.Cells["StatusCol"].Value = "Done"; row.Cells["DepositCol"].Value = row.Cells["TotalPriceCol"].Value; row.Cells["BalanceCol"].Value = String.Format("{0:C}", 0); } catch (Exception ex) { MessageBox.Show("There was an error. Please contact Jay with this message: " + ex.Message); } EnableButtonsBasedOnGrid(); }