Rinat
Rinat

Reputation: 598

SharePoint How To Get a ViewName

I need to get data from SharePoint by using web service. I did it, but i don't know how to get data from View.

XmlNode itemNode = spList.GetListItems(url[1], 
                                       null, 
                                       ndQuery, 
                                       ndViewFields, 
                                       null, 
                                       ndQueryOptions, 
                                       null);

Second parameter must be ViewName.

I have found System.Xml.XmlNode ndListView = spList.GetListAndView(url[1], ""); but it return default ViewName ("AllItems") guid. There's more than two views.

Is any idea?

Upvotes: 0

Views: 3301

Answers (2)

Sham
Sham

Reputation: 26

i have solved the problem. I have used List web service but there's another View. So I looked it and found the method i need GetViewCollection, as i remember. That's all!

Upvotes: 1

vvk
vvk

Reputation: 823

You can use GetList method, which returns a Caml List Schema and from which you can extract a description of all view.
GetList method

Upvotes: 0

Related Questions