I want to load fields of the default view for Sharepoint list through client object model (I am using Silverlight). Here are some relevant things I’ve found (on msdn here):
- class
Listhas propertyDefaultViewUrl[of typestring] - class
Listhas methodGetView(Guid) - class
Listhas propertyViews[of typeViewCollection] - class
ViewCollectionhas methodGetById(Guid) - class
ViewCollectionhas methodGetByTitle(string) - class
Viewhas propertyDefaultView[of typebool]
That’s everything I was able to find. As you can see there is no direct way of getting DefaultView (there is missing DefaultViewId property on List or GetByUrl(string) method on ViewCollection).
Seems to me as the only solution is to iterate through List.Views collection and check DefaultView property on each View. Which is kind of…well, inefficient…
Did I miss something? Anyone see some straigh solition?
Thanks for ideas.
Try LoadQuery using a LINQ statement
For Example:
MSDN SharePoint 2010 Silverlight COM article here
http://msdn.microsoft.com/en-us/library/ee538971.aspx