title: How to bind WPF Datagrid to a joined table
body: <p>I have a big problem. I try to bind my WPF <code>DataGrid</code> to a table, created with inner join. I have created a class for the info to convert successfully:</p>
  
  <pre><code>public class NeshtoSi
  {
      public NeshtoSi() { }
  
      public string ssn;
      public string name;
      public string surname;
  }
  </code></pre>
  
  <p>And then I create the inner-joined tables. Still when  I assign the <code>ItemsSource</code> and all values are transferred properly, but the <code>DataGrid</code> does not visualize them.</p>
  
  <pre><code>var dd = from d in dataContext.Medical_Examinations
           join p in dataContext.Patients on d.SSN equals p.SSN
           select new NeshtoSi { ssn = d.SSN, name = p.Name, surname = p.Surname };
  
  
  IQueryable&lt;NeshtoSi&gt; sQuery = dd;
  
  if (!string.IsNullOrEmpty(serName.Text))
      sQuery = sQuery.Where(x =&gt; x.name.Contains(serName.Text));
  if (!string.IsNullOrEmpty(serSurame.Text))
      sQuery = sQuery.Where(x =&gt; x.surname.Contains(serSurame.Text));
  if (!string.IsNullOrEmpty(serSSN.Text))
      sQuery = sQuery.Where(x =&gt; x.ssn.Contains(serSSN.Text));
  
  var results = sQuery.ToList();
  
  AnSearch.ItemsSource = sQuery;
  </code></pre>
  
  <p>I hope that someone can help me...</p>