Search code examples
c#asp.netsharepointsharepoint-2010sharepoint-webservice

Updating view properties SharePoint 2010


I am trying to create a view programatically using another view as a template. I have gotten everything working (creating the view and then using updateView). The only snag is I am trying to set TabularView=FALSE but the change is not taking. Here is the code I have so far

System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
System.Xml.XmlNode viewProperties = doc.CreateNode(System.Xml.XmlNodeType.Element,"View","");
System.Xml.XmlAttribute attr = doc.CreateAttribute("TabularView");
attr.Value = "FALSE";
viewProperties.Attributes.SetNamedItem(attr);
System.Xml.XmlNode resNode = view.UpdateView(listname, name, viewProperties, query, viewFields, null, null, rowLimit);

As usual the MSDN page on the updateView does not provide any information on the viewProperties parameter

Please note that I can only use WebServices


Solution

  • I cross posted this question on MSDN and got the following answer:

    Hi Kevin, According to your description, my understanding is that you want to set view property using web service. In the UpadateView method, the viewProperties has no TabularView attribute, so it will not work. In the viewPropeties tag, you can set the attribute such as as Editor, Hidden, ReadOnly, and Title. Here is a similiar thread for your reference:
    https://sharepoint.stackexchange.com/questions/5540/update-list-view-title-using-views-asmx-web-service Best Regards


    Zhengyu Guo TechNet Community Support