title: Binding Combobox SelectedValue from bound value in UserControl grid
body: <p>I've spent the last two days trying to make this happen, and I can't figure out what I am missing.  I have a WPF user control with a grid and within that grid are text boxes and comboboxes.  The DataContext of the grid is set in C# code with an object, and I've been able to two-way bind my text boxes to the grid's DataContext object.  Here is some sample code.  The object that is going into the ClinicInfoRoot is my Clinic object and one of it's properties is StateID (which is important in a moment)</p>
  
  <pre><code>private void Events_ClinicSelected( object sender, ClinicSelectedEventArgs e )
  {
      if ( !DesignerProperties.GetIsInDesignMode( this ) )
      {
          // Get the current logged in user object from arguments and set local
          this.CurrentLoggedInPDUser = e.CurrentLoggedInPDUser;
  
          // Bind the patient object to the window grid data context
          this.ClinicInfoRoot.DataContext = e.Clinic;
  
          // Set the mode and call mode manager
          this.SetMode( Mode.View );
          this.ModeManager();
      }
  }
  </code></pre>
  
  <p>Now for xaml:</p>
  
  <pre><code>&lt;Grid Name="ClinicInfoRoot" 
    Margin="0,0,10,10" 
    Validation.Error="ClinicInfoRoot_Error"&gt;
  
  &lt;TextBox Margin="82,28,0,0" 
           Name="txtName" 
           VerticalAlignment="Top" 
           HorizontalAlignment="Left" 
           Width="82" &gt;
  
      &lt;TextBox.Text&gt;
          &lt;Binding Path="Name" 
                   Mode="TwoWay" 
                   ValidatesOnDataErrors="True" 
                   ValidatesOnExceptions="True" 
                   NotifyOnValidationError="True" 
                   UpdateSourceTrigger="PropertyChanged"&gt;&lt;/Binding&gt;
      &lt;/TextBox.Text&gt;
  &lt;/TextBox&gt;
  
  &lt;ComboBox HorizontalAlignment="Left" 
            Margin="281,141,0,0" 
            Name="cbState" 
            VerticalAlignment="Top" 
            Width="73" 
            ItemsSource="{Binding Mode=OneWay}" 
            DisplayMemberPath="Abbrev" 
            SelectedValuePath="StateID" &gt;
      &lt;ComboBox.SelectedValue&gt;
          &lt;Binding ElementName="ClinicInfoRoot" 
                   Path="Clinic.StateID" 
                   Mode="TwoWay" 
                   ValidatesOnDataErrors="True" 
                   ValidatesOnExceptions="True" 
                   NotifyOnValidationError="True" 
                   UpdateSourceTrigger="PropertyChanged"&gt;&lt;/Binding&gt;
      &lt;/ComboBox.SelectedValue&gt;
  &lt;/ComboBox&gt;
  </code></pre>
  
  <p>I have been able to bind the textbox with the appropriate properties from the Clinic object, but the issue is with my State combobox.  I have bound the ItemsSource with a list of states from another object, and the combobox fills correctly.  However, I want the StateID property in the Clinic object to set what is showing in the combobox, but I can't figure out what the ElementName and Path properties should be for the SelectedValue.</p>
  
  <p>What is the syntax for the ElementName and Path in the binding for the SelectedValue of my combobox?</p>