I would like to have a Form with a table in it.
The first row will describe a Scale.
In each cell in the table, there will be a a checkBox button, that will have my choice. (only one can be chosen (validation))
**1** **2** **3**
a)______________checkBoxbttn_____________________ checkBoxbttn____________________ V
b) ____________ checkBoxbttn___________________________ V ___________________ checkBoxbttn
After marking only one checkBox in every row (validation), I’ll need to save each row’s choose in a parameter, for future use.
For the example above: int a = 3; int b = 2;
How can I implement that?
How the validations looks like?
I suggest you to use a
TableLayoutPanelwith one column and any number of rows. In each cell, place aPanel. In each panel, place threeRadioButtoncontrols, to ensure that only one among those is selected.To know which RadioButton is selected, you can iterate through each Panel’s controls and returning the first one checked.
Example:
To assign a specific value to a RadioButton, I would create a class deriving from it, with a property representing your value.
Example: