using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace EMSystem.Forms { public partial class ToDoListForm : Form { public ToDoListForm() { InitializeComponent(); } private void ToDoListForm_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'emsDataSet2.tasklist' table. You can move, or remove it, as needed. this.tasklistTableAdapter.Fill(this.emsDataSet2.tasklist); } // delete row from task list table/gridview list table private void delBtn_Click(object sender, EventArgs e) { foreach (DataGridViewRow item in this.toDoListGridView.SelectedRows) { // removes at place where you have clicked with your mouse toDoListGridView.Rows.RemoveAt(item.Index); } } //add button functionality private void addBtn_Click(object sender, EventArgs e) { // declaring the use of AddTaskForm AddTaskForm form = new AddTaskForm(); // shows AddTaskForm form.Show(); } // save button functionality private void saveBtn_Click(object sender, EventArgs e) { // updates data source table directly tasklistTableAdapter.Update(emsDataSet2); // notification about updated task list MessageBox.Show("ToDo List Updated!", "Update", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }