Protected Sub CheckBox2_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Dim gv As GridViewRow Dim chkH As CheckBox = CType(GridView1.HeaderRow.FindControl("CheckBox2"), CheckBox) If chkH.Checked = True Then For Each gv In GridView1.Rows Dim chk As CheckBox = CType(GridView1.Rows(gv.RowIndex).FindControl("CheckBox1"), CheckBox) chk.Checked = True Next Else For Each gv In GridView1.Rows Dim chk As CheckBox = CType(GridView1.Rows(gv.RowIndex).FindControl("CheckBox1"), CheckBox) chk.Checked = False Next End If End Sub Here is the sample image output.