title: DataGrid - "Two-way binding requires Path or XPath."
body: <p>I would like to display on DataGrid my object database</p>
  
  <pre><code>public class Student
  {
  public string Imie { get; set; }
  public string Nazwisko { get; set; }
  string Numer { get; set; }
  
  internal List&lt;Telefon&gt; Telefony { get; set; }
  internal Adres Adres { get; set; }
  }
  </code></pre>
  
  <p>In <strong>Adres</strong> and <strong>Telefon</strong> class I have obviously some extra fields.</p>
  
  <p>My XAML:</p>
  
  <pre><code>&lt;DataGrid Name="dataGrid" ItemsSource="{Binding Student}" AutoGenerateColumns="False" CellEditEnding="dataGrid_CellEditEnding" CurrentCellChanged="dataGrid_CurrentCellChanged" PreviewKeyDown="dataGrid_PreviewKeyDown"&gt;
          &lt;DataGrid.Columns&gt;
              &lt;DataGridTextColumn Header="Imie"        Binding="{Binding Imie}"/&gt;
              &lt;DataGridTextColumn Header="Nazwisko"    Binding="{Binding Nazwisko}"/&gt;
              &lt;DataGridTextColumn Header="Numer"       Binding="{Binding Numer}"/&gt;
              &lt;DataGridTextColumn Header="Ulica"       Binding="{Binding Adres.Ulica}"/&gt;
              &lt;DataGridTextColumn Header="KodPocztowy"       Binding="{Binding  Adres.KodPocztowy}"/&gt;
              &lt;DataGridTextColumn Header="Miasto"       Binding="{Binding Adres.Miasto}"/&gt;
              &lt;DataGridTextColumn Header="Tel. Numer"       Binding="{Binding Telefon.Numer}"/&gt;
              &lt;DataGridTextColumn Header="Tel. Operator"       Binding="{Binding Telefon.Operator}"/&gt;
          &lt;/DataGrid.Columns&gt;
      &lt;/DataGrid&gt;
  </code></pre>
  
  <p>I can easily get and set <strong>Imie</strong>, <strong>Nazwisko</strong> and <strong>Numer</strong> fields but when i'm trying to set value of <strong>Ulica</strong> (field in <strong>Adres</strong> class) compiler gives me this exception:</p>
  
  <pre><code>InvalidOperationException was unhandled
  Two-way binding requires Path or XPath.
  </code></pre>
  
  <p>Thanks for help.</p>