How can I select a radio button?

I have inserted 3 radio buttons inside a Button Group. One of the 3 radio button is already selected by default, before that the user actually makes its choose. If the choise of the user is the already selected button, the user push it again but it doesn't work: I have to select another button, and then select the button which I'm interested in. Why? How can I solve?
Thanks.

Answers (1)

Adam
Adam on 24 Aug 2016
Why would the user need to push it again? Do you have functionality under the radio button that triggers when they press it? If so can you not just run that by default for the selected option?
It isn't possibly in a button group to have none of the buttons selected as far as I am aware. You can if you just put the buttons on a regular panel and program the mutual exclusivity and everything else yourself.
Or you can add a button that actually calls some code based on the radio button selection or, more ugly, you could have a 'None' option in your radio buttons (or some more appropriate name) to initialise to. If you want to be really fussy you can disable it as an option as soon as the user chooses a different option if you want to always have something selected after the initial state.

Products

Asked:

on 24 Aug 2016

Answered:

on 24 Aug 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!