Results 1 to 3 of 3

Thread: [RESOLVED] DataGridView Loop

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    179

    Resolved [RESOLVED] DataGridView Loop

    I need to loop through my datagridview1 to obtain the name of each of the columns to set the attributes.

    I'm not sure what I need to look for when doing this.

    I tried:

    For Each Field As String In DataGridView1.DataGridViewColumn
    and
    For Each Field As String In DataGridView1.Columns

    But it's giving me errors.

    What would be the proper way to loop through the DatGridView and get the name of each column?

    Thx again!

  2. #2

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    179

    Re: DataGridView Loop

    Quote Originally Posted by cicatrix View Post
    vb.net Code:
    1. For Each col As DataGridViewColumn In DataGridView1.Columns
    2.     Debug.WriteLine(col.Name)
    3. Next
    I knew it was something simple!

    Ty!

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