private void DataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e) { var id = dataGridView1.Rows[e.RowIndex].Cells["TodosGrid_Id"].Value; var name = dataGridView1.Rows[e.RowIndex].Cells["TodosGrid_Name"].Value; var complete = dataGridView1.Rows[e.RowIndex].Cells["TodosGrid_Completed"].Value; logics.Rename(id.ToString(), name.ToString(), complete.ToString()); dataGridView1.DataSource = logics.List(); label1.Text = logics.ActiveTasks(0).ToString() + " Items left"; }
public Form1() { InitializeComponent(); logics = new TasksLogic(); dataGridView1.DataSource = logics.List(); dataGridView1.CellEndEdit += DataGridView1_CellEndEdit; label1.Text = logics.ActiveTasks(0).ToString() + " Items left"; }