Hello,
I have a big problem. I try to bind my WPF Datagrid to a table, created with inner join. I have created a class for the info to convert successfully:
public class NeshtoSi
{
public NeshtoSi() { }
public string ssn;
public string name;
public string surname;
}
And then I create the inner-joined tables. Still when I assign the itemssource and all values are transferred properly, but the datagrid does not visualize them.
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<NeshtoSi> sQuery = dd;
if (!string.IsNullOrEmpty(serName.Text))
sQuery = sQuery.Where(x => x.name.Contains(serName.Text));
if (!string.IsNullOrEmpty(serSurame.Text))
sQuery = sQuery.Where(x => x.surname.Contains(serSurame.Text));
if (!string.IsNullOrEmpty(serSSN.Text))
sQuery = sQuery.Where(x => x.ssn.Contains(serSSN.Text));
var results = sQuery.ToList();
AnSearch.ItemsSource = sQuery;
I hope that someone can help me...