validation of one cell of a Data Grid to another
I have two cells one is a radiobtnlist with 3 items pass, fail, NA
values of 1, 2, 3
i need to verify that if fail(2) is clicked that another cel text box txtcomm has some data (len > 0)
I keep getting an error that object not set to an instance
here is my code
Public Function chkPFNA_COMM()
Dim mystring As String
Dim i As Integer = 0
Dim x As TextBox
Dim dgi As DataGridItem
For Each dgi In dgPrep.Items
Dim id As Integer = Convert.ToInt32(dgPrep.DataKeys(dgi.ItemIndex))
Dim txtR_C As String = CType(dgi.FindControl("r_c"), TextBox).Text
Dim txtPFNA As String = CType(dgi.FindControl("btnPFNA"), RadioButtonList).SelectedValue
Dim txtCorr As String = CType(dgi.FindControl("chkcorr"), CheckBox).Checked
If txtPFNA = "2" Then
errPFNA.Text = "must supply failure"
chkPFNA_COMM = False
Exit Function
End If
Next
End Function
|