vendredi 16 décembre 2016

How to locate checkbox in gridview /

Attempting to use the code below to no avail - I cannot seem to locate the checkbox control. Note: the grid does return the expected number of rows. As indicated in the title I am trying to find the checkbox from another user control on the same parent page.

    Dim grid As GridView = CType(Me.Parent.FindControl(SearchControlID).FindControl("grdSearchResults"), GridView)

    For Each row As GridViewRow In grid.Rows
        Dim selectedRow As CheckBox = row.FindControl("chkRequestReference")
        If (selectedRow.Checked) Then
            rowSelected = True
            Exit For
        End If
    Next




Aucun commentaire:

Enregistrer un commentaire