Tuesday, March 29, 2016

How to set SharePoint list view 'Item Limit' with the option programmatically

Limit the total number of items returned to the specified amount



ClientContext clientContext = new ClientContext("http://hercules");
          clientContext.Credentials = new NetworkCredential("Peakfinder", "password@1");
          string listName = "Employess", viewName = "All Items";          
          bool paged = true;      
          List list = clientContext.Web.Lists.GetByTitle(listName);
          View view = list.Views.GetByTitle(viewName);
          view.Paged = paged;
          view.Update();
          clientContext.ExecuteQuery();

No comments:

Post a Comment