title: How to dynamically change dropdown list values by selecting another dropdown in Xamarin Forms
body: <p>Forgive the naming. I am trying to dynamically load a Dropdown list in Xamarin Forms (Purpose for this is to create a Signup form where users have multiple questions to answer and I don't want to repeat the question)</p>
  
  <pre><code>    private void InitalizeDropdown2And3()
      {
          dropdown1.ItemsSource.Clear();
          Items3.Clear();
          for (int i = 0; i &lt; 4; i++)
          {
              Items3.Add(i.ToString());
          }
      }
      private void OnDropdownSelected(object sender, ItemSelectedEventArgs e)
      {
          InitalizeDropdown2And3();
  
          if(!string.IsNullOrEmpty(e.SelectedIndex.ToString()))
          {
              Items3.Remove(e.SelectedIndex.ToString());
          }          
  
          dropdown1.ItemsSource.Clear();
          dropdown1.ItemsSource = Items3;
          dropdown1.SelectedIndex = 1;            
      }
  </code></pre>
  
  <p>I am not sure why but this is not working.</p>
  
  <p>Xamarin Code and Screen<a href="https://i.stack.imgur.com/G2dpF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/G2dpF.png" alt="enter image description here"></a></p>
  
  <pre><code>      &lt;StackLayout HorizontalOptions="FillAndExpand"
               VerticalOptions="Center"
               Spacing="10"
               Margin="20"&gt;
      &lt;local:Dropdown HorizontalOptions="FillAndExpand"
                      VerticalOptions="Center"
                      BackgroundColor="LawnGreen"
                      x:Name="dropdown"/&gt;
      &lt;local:Dropdown HorizontalOptions="FillAndExpand"
                      VerticalOptions="Center"
                      BackgroundColor="MediumSlateBlue"
                      x:Name="dropdown1"/&gt;
      &lt;local:Dropdown HorizontalOptions="FillAndExpand"
                      VerticalOptions="Center"
                      BackgroundColor="MediumOrchid"
                      x:Name="dropdown2"/&gt;
      &lt;StackLayout HorizontalOptions="FillAndExpand"
                   VerticalOptions="Center"
                   Padding="10"
                   BackgroundColor="LightGreen"&gt;
          &lt;Label HorizontalOptions="Center"
                 VerticalOptions="Center"
                 x:Name="label"/&gt;
   &lt;/StackLayout&gt;
  </code></pre>