通过客户端对象模型编程获取SharePoint 2010列表视图

一个简短的例子,在SharePoint 2010中通过客户端对象模型获取列表视图。

Dim objmyList As SP.List = g_objCore.Security.Web.Lists.GetByTitle(“**Your List Name*”)

Dim objmyView As SP.View = objmyList.Views.GetByTitle(“*Your View Name*”)

Dim objViewFldColl As SP.ViewFieldCollection = objmyView.ViewFields

g_objCore.Security.ClientContext.Load(objViewFldColl)

g_objCore.Security.ClientContext.ExecuteQuery()
现在你就可以遍历objViewFldColl来获取视图中的字段了。

 

参考资料

Get List Views in SharePoint 2010 client object model programmatically

posted @ 2010-09-06 20:39  Sunmoonfire  阅读(652)  评论(0编辑  收藏  举报