https://social.msdn.microsoft.com/Forums/office/en-US/d9c22309-c4f7-469d-a2cc-d783391a7ee2/programmatically-creating-folder-in-custom-list?forum=sharepointdevelopmentprevious https://social.msdn.microsoft.com/Forums/office/en-US/fcd1a132-5c7f-47ca-aebf-666c70b84685/programmatically-change-spview-folders-setting-to-show-all-items-without-folders?forum=sharepointdevelopmentlegacy Found above: Thanks Serge! also had to do this: var view = paList.Views.Add(viewName, viewFields, string.Empty, 100, true, true); view.Scope = SPViewScope.Recursive; view.Update(); web.Update(); because: paList.Views.Add(viewName, viewFields, string.Empty, 100, true, true); paList.Views[viewName].Scope = SPViewScope.Recursive; paList.Views[viewName].Update(); web.Update(); didn't work :-( No wander: paList.Views[viewName] gets a new instance each time it is invoked. So the code above is equivalent to: paList.Views.Add(viewName, viewFields, string.Empty, 100, true, true); //paList.Views[viewName].Scope = SPViewScope.Recursive; var m_paList = paList.Views[viewName]; m_paList.Scope = SPViewScope.Recursive; //paList.Views[viewName].Update(); m_paList = paList.Views[viewName]; m_paList Update();

Comments

Popular posts from this blog

CREATE DATABASE (SMO)

Enable JSON serialization in your Visual Studio 2010 project

jQuery | remove inline style