标签:
private void BindData() { SPWeb web = SPContext.Current.Web; SPList list = web.Lists["我的文档"]; SPListItemCollection items = GetItems(list); GridView1.DataSource = items.GetDataTable(); GridView1.DataBind(); } private SPListItemCollection GetItems(SPList list) { SPQuery query = new SPQuery(); query.Folder = list.RootFolder; ; query.ViewAttributes = "Scope=\"RecursiveAll\""; SPListItemCollection itemCollection = list.GetItems(query); return itemCollection; }
参考文献:http://blog.csdn.net/chenxinxian/article/details/8425166
标签:
原文地址:http://www.cnblogs.com/Percy/p/4312225.html