Last post Dec 13, 2006 03:48 AM by rexlin
Dec 12, 2006 05:01 PM|Alcoalex|LINK
I'm attempting to run the below script to get the ID value of check boxes in my datagrid (dgBook).
Protected Sub btnTransfer_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnTransfer.Click
Dim i As Integer
Dim blnIsChecked As Boolean
For i = 0 To dgBook.Items.Count - 1
blnIsChecked = DirectCast(dgBook.Items(i).Cells(4).FindControl("BookID"), Web.UI.WebControls.CheckBox).Checked
If blnIsChecked = True Then
Response.Write(i & " IS Checked <BR>")
Response.Write(i & " IsNotChecked ")
My problem is that I get this error message and i'm not sure what it means - or how to resolve it, can anyone help?
Dec 12, 2006 10:12 PM|rexlin|LINK
What control do you actually use? DataGrid? However, i notice that you are using GridView according to the error message.
Dec 13, 2006 03:28 AM|Alcoalex|LINK
Dec 13, 2006 03:35 AM|satish_nagdev|LINK
i think you should try to find control using gridview.rows(index).cell(index). also make sure to check that to find control in row of type datarow
i hope you understand what i want to say. try atleast, if stuck post code here we will try to help u
Dec 13, 2006 03:48 AM|rexlin|LINK