I have created my own dataset: this.abcTableAdapter.Fill(this.dataSet1.abc);
And I created DataGridViewComboBoxColumn called AllGrades:
DataGridViewComboBoxColumn AllGrades = new DataGridViewComboBoxColumn();
for (int grade = 5; grade <= 10; grade++)
{
AllGrades.Items.Add(grade);
}
AllGrades.DataPropertyName = "Grade";
AllGrades.HeaderText = "Grade";
AllGrades.Width = 60;
AllGrades.MaxDropDownItems = 6;
AllGrades.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing;
dataGridView1.Columns.Add(AllGrades);
In a dataGridView I have a column Grades, which is connected to a database. I have created this code above in a case, if its needed to repair the grade. That
s why I decided to use a dropDown menu. The code above shows in a dropDown menu grades from 5 to 10.
I did aditional button Save, which will save the new selected value into db. But I am struggling to create additional code for inserting the new selected grade back into database.
Can someone help me out how to do it?