I have a gridview with checkboxes and I would like to take the checked boxes value to the next page. I have a click button and I donot know how to tie RowDataBound event with a click event. thanks for the help
Protected Sub gvPlansProposal_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvPlansProposal.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim cb As New CheckBox
cb = e.Row.FindControl("CheckBox1")
If cb.Checked Then
'add the values you want from e.Row.Cells(index#).Text to some collection
'then add to a session var. which will be available to you on the next page
End If
End If
End Sub
Protected Sub btnNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext.Click
End Sub
End Class
Protected Sub gvPlansProposal_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvPlansProposal.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim cb As New CheckBox
cb = e.Row.FindControl("CheckBox1")
If cb.Checked Then
'add the values you want from e.Row.Cells(index#).Text to some collection
'then add to a session var. which will be available to you on the next page
End If
End If
End Sub
Protected Sub btnNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext.Click
End Sub
End Class