I am trying to create a switch statement which adds a 1,2 or 3 to the question type column of my questionDataTable depending on which checkbox is ticked in the corresponding row to the Question ID row which I am trying to increment every time the button is pressed. I'm not sure if I should create the row and then increment the ID or would that create an error because ID is not allowed to be NULL.
I have looked around and can't seem to find any resources to help me.
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
this.checkBox2.Enabled = !this.checkBox1.Checked;
this.checkBox3.Enabled = !this.checkBox1.Checked;
if (!this.checkBox2.Enabled)
{
this.checkBox2.Checked = false;
this.checkBox3.Checked = false;
}
}
private void checkBox2_CheckedChanged(object sender, EventArgs e)
{
}
private void checkBox3_CheckedChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if(checkBox1.Checked)
{
this.questionDataTableBindingSource.AddNew();
int questiontype = 0;
switch (questiontype)
{
case1:
this.Validate();
}