I added a checkbox in gridview.That gridview shows data of sharepoint picture library like photographer name, caption, image name ,type. There is another column in library which is count. now i want to update column field after selection of checkbox and click on vote button. please suggest the solution?
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 S开发者_StackOverflowPListItem
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
精彩评论