this is the code of my page:
OrganizationContext ctx = new OrganizationContext();
public EmployeeList()
{
InitializeComponent();
ctx.Load(ctx.GetEmployeesQuery(), LoadBehavior.MergeIntoCurrent, EmployeesLoaded, null);
}
private void EmployeesLoaded(LoadOperation lo)
{
dataGrid1.ItemsSource = lo.Entities;
}
The callback executes, and the LoadOperation.Entities.Count is 291 but for some reason the grid doesnt display anything. By the way i've tried setting the DataContext property and still doesnt work.
1st,make your DataGrid's attribute AutoGenerateColumns="True"; 2nd the code should like:
OrganizationContext ctx = new OrganizationContext();
public EmployeeList()
{
InitializeComponent();
LoadOperation lo=ctx.Load(ctx.GetEmployeesQuery());
dataGrid1.ItemsSource = lo.Entities;
}