I want to show a list on an .aspx site. Therefore I have to use the SP client object model.
I found the following tutorial, but this doesn't use the client libraries: http://social.technet.microsoft.com/wiki/contents/articles/30287.binding-gridview-with-sharepoint-list.aspx
My code so far looks the following:
ClientContext clientContext = GetContext(accessToken);
Web web = clientContext.Web;
clientContext.Load(web);
clientContext.ExecuteQuery();
// Get the email input list.
List inboxList = web.Lists.GetByTitle("InboxList");
Microsoft.SharePoint.Client.ListItemCollection items = inboxList.GetItems(new CamlQuery());
clientContext.Load(inboxList);
clientContext.Load(items, ic => ic.Include(i => i["DisplayName"], i => i["Client_Title"], i => i["HasUniqueRoleAssignments"]));
clientContext.ExecuteQuery();
foreach (Microsoft.SharePoint.Client.ListItem i in items)
{
clientContext.Load(i);
}
clientContext.ExecuteQuery();
oGrid.DataSource = items;
oGrid.DataBind();
But this shows only some "meta data" of the list item collection, see screenshot:

If I use oGrid.DataSource = inboxList; I get an InvalidOperationException because the data source isn't type of IListSource, IEnumerable nor IDataSource.
If I use oGrid.DataSource = inboxList.DataSource; I get an PropertyOrFieldNotInitializedException, but I don't know how to load this attribute (via clientContext.Load it didn't work)?!