tring siteUrl = "the name of my sharepointsite";
ClientContext clientContext = new ClientContext(siteUrl);
clientContext.AuthenticationMode = ClientAuthenticationMode.FormsAuthentication;
clientContext.FormsAuthenticationLoginInfo = new FormsAuthenticationLoginInfo("myusername", "mypassword");
List oList = clientContext.Web.Lists.GetByTitle(item.Header);
CamlQuery query = CamlQuery.CreateAllItemsQuery(100);
//CamlQuery camlQuery = new CamlQuery();
// camlQuery.ViewXml = "<View><RowLimit>100</RowLimit></View>";
ListItemCollection collListItem = oList.GetItems(query);
clientContext.Load(collListItem);
clientContext.ExecuteQuery();
foreach (ListItem oListItem in collListItem)
{
mylist.mydynamicgrid.RowDefinitions.Add(new RowDefinition
{
Height = new GridLength(1, GridUnitType.Auto),
Tag = item
});
}