Results 1 to 2 of 2

Thread: [RESOLVED] How to pick up all Datagrids in a form.

  1. #1

    Thread Starter
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Resolved [RESOLVED] How to pick up all Datagrids in a form.

    Hi there,

    I have lots of datagrids on one form. However, the datagrid controls are all on different tabpages and tablelayoutpanels.

    How can i programmatically "pick" up all the datagrid in one form, even though they are child controls of other controls?

    Code:
        For Each tabpg As TabPage In Me.tabStatus.TabPages
                For Each ctl As Control In tabpg.Controls
                    If TypeOf ctl Is DataGridView Then
                        Dim dgv As DataGridView = ctl
                        If dgv.Columns.Count > 0 Then
                      'Do something
                        End If
                        dgv.ClearSelection()
                    End If
                Next
            Next
    If you find my thread helpful, please remember to rate me

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: How to pick up all Datagrids in a form.

    Please mark you thread resolved using the Thread Tools as shown

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