title: Reseting Radio Buttons in Xamarin Forms 5
body: <p>I am trying to create a Trivia App.  I have some very basic Xamarin Form code implementing a Radio Button.  The buttons work fine (ie a selection is registered and processed properly).  The issue is that after the first question is answered, the radio button selection persists when the second question is displayed.  Is there a way to reset the radio buttons between questions so that they are all not selected?</p>
  <p>Here is the basic xaml code and the code behind:</p>
  <p>Xaml:
  </p>
  <pre><code>                 &lt;StackLayout Margin=&quot;20&quot;&gt;
                       &lt;RadioButton x:Name=&quot;Option0&quot; CheckedChanged=&quot;RadioButton_CheckedChanged&quot; IsTabStop=&quot;False&quot; IsChecked=&quot;False&quot;&gt;&lt;/RadioButton&gt;
                       &lt;RadioButton x:Name=&quot;Option1&quot; CheckedChanged=&quot;RadioButton_CheckedChanged&quot; IsTabStop=&quot;False&quot; IsChecked=&quot;False&quot;&gt;&lt;/RadioButton&gt;
                       &lt;RadioButton x:Name=&quot;Option2&quot; CheckedChanged=&quot;RadioButton_CheckedChanged&quot; IsTabStop=&quot;False&quot; IsChecked=&quot;False&quot;&gt;&lt;/RadioButton&gt;
                       &lt;RadioButton x:Name=&quot;Option3&quot; CheckedChanged=&quot;RadioButton_CheckedChanged&quot; IsTabStop=&quot;False&quot; IsChecked=&quot;False&quot;&gt;&lt;/RadioButton&gt;
                   &lt;/StackLayout&gt;
  </code></pre>
  <p>Code behind:  (Note: getQuestion() has the logic to display the next question so I have not included it here and I suspect something needs to be done at // do something to reset the radio button but I am not sure what to do)</p>
  <pre><code>    void RadioButton_CheckedChanged(System.Object sender, Xamarin.Forms.CheckedChangedEventArgs e)  // sender is of class System.Object and must be converted in the proper type
      {
          Debug.WriteLine(&quot;\nRadio Button Clicked&quot;);
          Debug.WriteLine(&quot;sender: &quot; + sender);
          Debug.WriteLine(&quot;e: &quot; + e);
  
          var s = sender;
          var radioEvent = e;
  
          // converts sender to Radio Button type
          var radioButton = (RadioButton)sender;
          // Once in Radio Button type now you can see and use content
          string contentString = radioButton.Content.ToString();
          Debug.WriteLine(&quot;contentString: &quot; + contentString);
  
          if (radioButton.IsChecked == true)
          {
  
              if (contentString == Movie.Text)
              {
                  DisplayAlert(&quot;Correct&quot;, &quot;You're Good!&quot;, &quot;OK&quot;);
                  Debug.WriteLine(&quot;Correct Answer&quot;);             
                  ans_correct = ans_correct + 1;
                  // do something to reset the radio button
                  getQuestion();
  
              }
              else
              {
                  DisplayAlert(&quot;Whoops&quot;, &quot;Wrong Agian!&quot;, &quot;OK&quot;);
                  Debug.WriteLine(&quot;Wrong Answer&quot;);
                  ans_wrong = ans_wrong + 1;
              }
          }
      }
  </code></pre>