Android Question Radio Button Groups

Discussion in 'Android Questions' started by Derek Jee, Jul 20, 2015.

  1. Derek Jee

    Derek Jee Active Member Licensed User

    Hi there

    I have some radio buttons in a panel which allows only one to be selected. They have all been added in code and not the designer. Is there a way to get the value of selected one without having to interrogate the radio buttons individually? I am sure I've missed something and hope someone can tell me what it is..

    Thank you :)


    Derek
     
  2. klaus

    klaus Expert Licensed User

    As you have added the RadioButtons in the code you should set the Tag property to an index and set the EventName the same for all RadioButtons.
    Then in the RadioButtons.CheckedChange event you should use Sender to get the the RadioButton that raised the event and with Tag property you know which one raised.
     
    RandomCoder likes this.
Loading...