想要更新gridview中所选复选框的sharepoint文档库的计数字段

时间:2011-09-21 10:04:06

标签: c# sharepoint-2010

我在gridview中添加了一个复选框。gridview显示了共享点图片库的数据,如摄影师姓名,标题,图片名称,类型。 库中有另一列是重要的。 现在我想在选中复选框后更新列字段,然后单击投票按钮。 请提出解决方案?

 Using site As SPSite = New SPSite("http://tcs393316:12345")        
Dim web As SPWeb = SPContext.Current.Web        
            Dim docLib As SPDocumentLibrary = CType(web.Lists("MyPortalImageLibrary"), SPDocumentLibrary)        
            Dim items As SPListItemCollection = docLib.Items        Dim item As SPListItem        
            Dim dt As DataTable = New DataTable()        
            dt.Columns.Add(New DataColumn("Type", GetType(String)))        
            dt.Columns.Add(New DataColumn("Name", GetType(String)))        
            dt.Columns.Add(New DataColumn("PhotoGrapherName", GetType(String)))       
            dt.Columns.Add(New DataColumn("Caption", GetType(String)))         
            dt.Columns.Add(New DataColumn("Count", GetType(Int32)))        Dim dr As DataRow For Each item In items        
                dr = dt.NewRow()        dr("Type") = item("Type").ToString()        
                dr("Name") = item("Name").ToString()        
                dr("PhotoGrapherName") = item("PhotoGrapherName").ToString()        
                dr("Caption") = item("Caption").ToString()        dr("Count") = item("Count").ToString()        
                dt.Rows.Add(dr)        
            Next        
            Dim image As ImageField = New ImageField       
            image.DataImageUrlField = "Name"       
            image.HeaderText = "Image"       
            GridView1.Columns.Add(image)      
            GridView1.DataSource = dt      
            GridView1.DataBind()       
        End Using       

0 个答案:

没有答案