I have a problem with DataGrid in wpf
this is a class :
class Superviser
{
public long Id = 0;
public string name = "";
public string father = "";
public string code = "";
}
and this is a function that build a list of this class object
public List<Superviser> allSuperviser()
{
return db.tbPersons.Where(i => i.level == StaticsObject.isSuperviser).Select(x => new Superviser
{
Id = x.Id,
name = x.firstName,
father = x.father,
code = x.code,
}).ToList();
}
and I use this code to set this list in datagrid
dgvPerson.ItemsSource = classPerson.allSuperviser();
but when run program datagrid is empty !
tip : The list is not empty.
Where is the problem?
How do I display this list on DataGrid?