Find Checkbox Control inside gridview in VB

By bryan tugade
Access over 40 UI widgets with everything from interactive menus to rich charts.

We can find checkbox inside gridview by using Findcontrol.

Imports System

Partial Class Default4
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      

         For i As Integer = 0 To GridView1.Rows.Count - 1

             Dim iCheckbox As CheckBox = CType(GridView1.Rows(i).FindControl("Checkbox1"), CheckBox)
            iCheckbox.Checked = False
        Next

    End Sub
End Class

Related FAQs

We can select and deselect checkbox in gridview in onPostback event of checkbox in gridview header.
We can select and deselect checkbox in gridview in onPostback event of checkbox in gridview header.
Find Checkbox Control inside gridview in VB  (563 Views)