private void buttonUpdate_Click(object sender, EventArgs e) { object[] arr = new object[dataGridView1.Columns.Count]; dataGridView1.Columns.CopyTo(arr, 0); String x = arr[0].ToString(); x = x.Substring(33, x.IndexOf(',') - 33); switch (x) { case "Note ID": noteString = user.openNote(this.note_id); richTextBox1.Text = noteString.ElementAt(6); dataGridView1.Width = 447; richTextBox1.Show(); buttonModify.Show(); buttonSave.Show(); buttonClose.Show(); CreateYourNote.Show(); break; case "Course ID": DataTable notes = user.getNotesByCourse(this.course_id); dataGridView1.DataSource = notes; dataGridView1.Refresh(); break; } }
private void btnAddNew_Click(object sender, EventArgs e) { dataGridView1.Width = 447; richTextBox1.Show(); buttonModify.Show(); buttonSave.Show(); buttonClose.Show(); CreateYourNote.Show(); }