Results 1 to 3 of 3

Thread: Check all boxes in a datagridview (Resolved)

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    259

    Check all boxes in a datagridview (Resolved)

    I am trying to check all the text boxes in a datagrid view with this
    VB Code:
    1. Dim ctl As Control
    2.         Dim cbx As CheckBox
    3.         For Each ctl In Me.dgvPosiPay.Controls
    4.             If ctl.GetType Is cbx.GetType Then
    5.                 ctl = DirectCast(ctl, CheckBox)
    6.                 If ctl.Checked = False Then
    7.                     ctl.checked = True
    8.                 End If
    9.             End If
    10.         Next
    I am getting the error 'checked' is not a member of 'System.Windows.Forms.Control'. and it is underlining the ctl.checked in the second if statement. I am pretty sure my problem is with the Me.dgvPosiPay.Controls part of the code block but I am not sure what the correct syntax should be.
    Last edited by FastEddie; Aug 12th, 2008 at 09:37 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width