wont add updated check boxes from gridview to arraylist
On my aspx page I have a gridview template that when it is rendered has
100 - 200 rows and each row has a check box.
When the page loads 5 check boxes are automatically checked. If I manually
check another 3 then press the submit button, then loop through all the
gridview rows to find out which rows had a checked box then it still
remembers the original 5. How do I make it remember the updated 8?
Protected Sub mySubmitButton_Click(sender As Object, e As EventArgs)
Dim myArray As ArrayList = New ArrayList()
For Each myRow As GridViewRow In MyGridview.Rows
If CType(myRow.FindControl("MyCheckbox"),
CheckBox).Checked Then
myArray.Add(MyGridview.DataKeys(MyRow.RowIndex).Value)
End If
Next
'add to DB myArray
End Sub
I tried this on the gridview in the asp.net and it made no difference
ViewStateMode="Disabled" and ViewStateMode="Enabled"
Thanks for the help
No comments:
Post a Comment