'html markup inside the TemplateField
<asp:CheckBox ID="cbWeight" runat="server" Checked='<%# Eval("WeightBased") %>' Enabled="false" />
'code behind file
Public Sub DoMath()
For row As Integer = 0 To gvW.Rows.Count -1
Dim cb As CheckBox = TryCast(gvW.Rows(row).FindControl("cbWeight"), CheckBox)
If not cb Is Nothing Then
'it always shows as Nothing
'also does not work
'gvW.Rows(row).Cells(7).FindControl("cbWeight")
End If
'other code deleted for simplicity and cause this is the only part not working
Next
End Sub

New Topic/Question
Reply



MultiQuote




|