title: How to create dynamic Radio Button Group in Xamarin Forms?
body: <p>How can I create UI as per below with dynamic questions? currently I have hard coded Questions and options. But now requirement is to display dynamic questions. Options will be same like 1 to 5 radio buttons. But as per the Xamarin Forms controls list there is no Control like Radio button group. So how can I achieve this?</p>
  
  <p>Currently My single question is added like : </p>
  
  <pre><code>&lt;StackLayout Margin="0,15"&gt;
                                          &lt;Grid&gt;
                                              &lt;Grid.ColumnDefinitions&gt;
                                                  &lt;ColumnDefinition Width="20*"/&gt;
                                                  &lt;ColumnDefinition Width="12*"/&gt;
                                                  &lt;ColumnDefinition Width="12*"/&gt;
                                                  &lt;ColumnDefinition Width="12*"/&gt;
                                                  &lt;ColumnDefinition Width="12*"/&gt;
                                                  &lt;ColumnDefinition Width="12*"/&gt;
                                                  &lt;ColumnDefinition Width="20*"/&gt;
                                              &lt;/Grid.ColumnDefinitions&gt;
                                              &lt;Grid.RowDefinitions&gt;
                                                  &lt;RowDefinition Height="30*"/&gt;
                                                  &lt;RowDefinition Height="25"/&gt;
                                                  &lt;RowDefinition Height="20"/&gt;
                                              &lt;/Grid.RowDefinitions&gt;
  
                                              &lt;Label Grid.ColumnSpan="7" Grid.Column="0" Grid.Row="0" Text="How do you rate the quality of food on offer?" VerticalTextAlignment="Center" FontFamily="SF-UI-Text-Regular" FontSize="24"/&gt;
                                              &lt;Label Grid.Column="0" Grid.Row="2" Text="Bad" VerticalTextAlignment="Center" HorizontalTextAlignment="End" FontFamily="SF-UI-Text-Regular" FontSize="15"/&gt;
                                              &lt;Label Grid.Column="1" Grid.Row="1" Text="1" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" FontFamily="SF-UI-Text-Regular" FontSize="15"/&gt;
                                              &lt;Label Grid.Column="2" Grid.Row="1" Text="2" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" FontFamily="SF-UI-Text-Regular" FontSize="15"/&gt;
                                              &lt;Label Grid.Column="3" Grid.Row="1" Text="3" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" FontFamily="SF-UI-Text-Regular" FontSize="15"/&gt;
                                              &lt;Label Grid.Column="4" Grid.Row="1" Text="4" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" FontFamily="SF-UI-Text-Regular" FontSize="15"/&gt;
                                              &lt;Label Grid.Column="5" Grid.Row="1" Text="5" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" FontFamily="SF-UI-Text-Regular" FontSize="15"/&gt;
                                              &lt;BoxView BackgroundColor="#FAFAFA" Grid.ColumnSpan="5" Grid.Column="1" Grid.Row="2"/&gt;
                                              &lt;Image Grid.Column="1" Grid.Row="2" x:Name="RbtnFoodQuality1" Source="radio_button.png" HeightRequest="10" WidthRequest="10"&gt;
                                                  &lt;Image.GestureRecognizers&gt;
                                                      &lt;TapGestureRecognizer Tapped="RbtnFoodQuality1Tapped" NumberOfTapsRequired="1"/&gt;
                                                  &lt;/Image.GestureRecognizers&gt;
                                              &lt;/Image&gt;
                                              &lt;Image Grid.Column="2" Grid.Row="2" x:Name="RbtnFoodQuality2" Source="radio_button.png" HeightRequest="10" WidthRequest="10"&gt;
                                                  &lt;Image.GestureRecognizers&gt;
                                                      &lt;TapGestureRecognizer Tapped="RbtnFoodQuality2Tapped" NumberOfTapsRequired="1"/&gt;
                                                  &lt;/Image.GestureRecognizers&gt;
                                              &lt;/Image&gt;
                                              &lt;Image Grid.Column="3" Grid.Row="2" x:Name="RbtnFoodQuality3" Source="radio_button.png" HeightRequest="10" WidthRequest="10"&gt;
                                                  &lt;Image.GestureRecognizers&gt;
                                                      &lt;TapGestureRecognizer Tapped="RbtnFoodQuality3Tapped" NumberOfTapsRequired="1"/&gt;
                                                  &lt;/Image.GestureRecognizers&gt;
                                              &lt;/Image&gt;
                                              &lt;Image Grid.Column="4" Grid.Row="2" x:Name="RbtnFoodQuality4" Source="radio_button.png" HeightRequest="10" WidthRequest="10"&gt;
                                                  &lt;Image.GestureRecognizers&gt;
                                                      &lt;TapGestureRecognizer Tapped="RbtnFoodQuality4Tapped" NumberOfTapsRequired="1"/&gt;
                                                  &lt;/Image.GestureRecognizers&gt;
                                              &lt;/Image&gt;
                                              &lt;Image Grid.Column="5" Grid.Row="2" x:Name="RbtnFoodQuality5" Source="radio_button.png" HeightRequest="10" WidthRequest="10"&gt;
                                                  &lt;Image.GestureRecognizers&gt;
                                                      &lt;TapGestureRecognizer Tapped="RbtnFoodQuality5Tapped" NumberOfTapsRequired="1"/&gt;
                                                  &lt;/Image.GestureRecognizers&gt;
                                              &lt;/Image&gt;
                                              &lt;Label Grid.Column="6" Grid.Row="2" Text="Good" VerticalTextAlignment="Center" HorizontalTextAlignment="Start" FontFamily="SF-UI-Text-Regular" FontSize="15"/&gt;
                                          &lt;/Grid&gt;
                                      &lt;/StackLayout&gt; 
  </code></pre>
  
  <p>Now I have to handle Tapped event for every controls dynamically. Is this possible If I am using viewcell and bind it? </p>
  
  <p>Or any other way to achieve this kind of functionality and UI?
  <a href="https://i.stack.imgur.com/K87OS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K87OS.jpg" alt="Feedback"></a></p>