开发者

i only want the checked items in the arraylist to be added

having trouble only adding the checkboxstatus's that are checked to the gridview.

Protected Sub atasks_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim tasknamelist As New List(Of Boolean)

For Each row As GridViewRow In GridView1.Rows
    ' Selects the text from the TextBox

    Dim checkboxstatus As CheckBox = CTyp开发者_开发问答e(row.FindControl("tasknamebox"), CheckBox)
    tasknamelist.Add(checkboxstatus.Checked)




Next
GridView2.DataSource = tasknamelist
GridView2.DataBind()
UpdatePanel2.Update()

End Sub


GridView1.Rows(0) should just be row (as you declared it)

 tasknamelist = checkboxstatus.Checked

is wrong, you assign a bool to a list, try this:

Dim tasknamelist As New List(Of Boolean)
tasknamelist.Add(checkboxstatus.Checked)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜