I have multiple panels and on each panel I have 2 RadioButtons. I need a way to check if a radiobutton has not been selected within each panel. If the panel contains 2 radiobuttons during a loop and if those 2 radiobuttons are not selected the variable (submit) would then be set to false.
Here is my code so far –
foreach(Panel panels in groupBox2.Controls)
{
foreach (RadioButton radio in panels.Controls)
{
if (!radio.Checked)
{
submit = false;
}
}
}
By default each panel will only contain one radio checked it the radio buttons
AutoCheckis true, Anyway to your question: