Dear Team,
Currently the RadioButtons are grouped by the ownership in a container.
If I have two or more RadioButton groups in one form, I need to place the RadioButtons into separate sub-containers, thus limiting my control layout options.
Is there an easy way to group siblings, without nesting containers?
I wonder if you could add a “RadioButtonGroup” property to the RadioButton control.
This would work like this:
rbOptionA1.RadioButtonGroup = “GroupA”;
rbOptionA2.RadioButtonGroup = “GroupA”;
rbOptionA3.RadioButtonGroup = “GroupA”;
rbOptionB1.RadioButtonGroup = “GroupB”;
rbOptionB2.RadioButtonGroup = “GroupB”;
rbOptionB3.RadioButtonGroup = “GroupB”;
Thanks,
Kizameon
Hi Kizameon,
Thank you for the detailed description.
The RadioButton control is supposed to be part of a visible container (Panel/Groupbox) just like in WinForms.
In Wisej, RadioButton controls have the AutoCheck property which Returns or set a value indicating whether the Checked or Checked values and the RadioButton’s appearance are automatically changed when the RadioButton itself is clicked. RadioButton.AutoCheck Property (wisej.com)
The way to get around your issue is to simply set the AutoCheck property to false and with that you can have total control on which radio button to check/uncheck.
You can set your groups by populating the Tag property of the control, but if you’re already using it for other purposes Wisej has the property UserData that you can use to assign your groups. (something like UserData.RadioGroup).
I have attached a sample and used the Tag property to achieve the desired results.
Hope this helps, let me know if you need anything else.
Best wishes,
Alaa
Hi Alaa,
please see the picture attached for sample demonstration.
I have added 6 radio buttons in one container.
Color: ( ) Red ( ) Green ( ) Blue
Size: ( ) Small ( ) Medium ( ) Big
Because the 6 radio buttons are located insde one container (e.g. Group Box), I can only select one radio button at a time out of six.
I cannot select combination of one Size and one Color.
In order to do so, I need to create sub-containers (panels or grou boxes) for each radio button group.
There could be an easier way to do so.
For example the pure HTML input type=radio has the name attribute, which allows easy grouping of the radiobuttons.
<input type=”radio” id=”id1″ name=”color” value=”Red”>
<input type=”radio” id=”id2″ name=”color” value=”Green”>
<input type=”radio” id=”id3″ name=”size” value=”Small”>
<input type=”radio” id=”id4″ name=”size” value=”Big”>
The WiseJ RadioButton control can get a handy property GroupName, which will be used for iteration in order to find the next radiobutton in the group.
Hopefully this helps.
Hi Kizameon,
Can you please give us more details on what you’re trying to achieve ?
Thank you,
Alaa
Please login first to submit.