Binding Results to a DataGrid

Jun 10, 2011 at 8:18 PM

How do I bind the results to a DataGrid?

Currently I'm using this snippet of code from the walk-thru:

 OrganizationResponse response = ((IOrganizationService

 EntityCollection results = (EntityCollection)response["EntityCollection"];

)result.AsyncState).EndExecute(result);      

Then I'm doing:

this.Dispatcher.BeginInvoke(() => dataGrid1.ItemsSource = results.Entities);

but getting undesired results.  How can I display the data that I retrieved?