Hi,
You can try the following code to implement the same.
Protected Sub GridView1_RowCr eated(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Grid ViewRowEventArg s) Handles GridView1.RowCr eated
If e.Row.RowType = DataControlRowT ype.DataRow Then
Dim chb As CheckBox = e.Row.Cells(2). FindControl("Ch eckBox1")
AddHandler chb.CheckedChan ged, AddressOf check_changed
End If
End Sub
Public Sub check_changed(B yVal sender As Object, ByVal e As EventArgs)
Response.Write( Me.GridView1.Da taKeys.Item(CTy pe(CType(sender ,
CheckBox).Paren t.Parent, GridViewRow).Ro wIndex).Value)
End Sub
Regards,
Manish
www.componentone.com
"Wannabe" wrote:
I have a gridview that has a label field and a checkbox field in it. I have
the checkbox set to autopost when changed. How can I get the datakey value
that is assigned to that row when a checkbox is either checked or unchecked?