I want to get all visible columns (Hidden == false) for specific list in sharePoint site, I tried to look through the SharePointWebService.Lists.GetList(listName), but couldn’t find anything useful, also checked the methods provided by the Lists WebService and also nothing new,
Please advice.
You can use the GetListAndView method of the Lists web service to get the schemas for the list and a view.
From the documentation, if you leave the
viewNameparameter empty, the default view will be returned. Then, you can read the<ViewFields></ViewFields>node for the list of fields.*Edit*
Turns out using XPath to query the returned XML was tougher than I thought… here is what I came up with:
Looks like you have to have a
XmlNamespaceManagerotherwise your query always returns no values. Something about specifying the namespace… Here is a good reference.