private void FormReportTicket_Load(object sender, EventArgs e) { try { var ticket = logic.GetTickets(); if (ticket != null) { dataGridView.Rows.Clear(); int sum = 0; foreach (var tick in ticket) { dataGridView.Rows.Add(new object[] { tick.WorkerFIO, tick.TypeTicket, tick.Status, }); sum++; } dataGridView.Rows.Add(new object[] { "", "Итого", sum }); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }