Need advice on looping through selected rows for printing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Beagley
    New Member
    • Mar 2008
    • 5

    Need advice on looping through selected rows for printing

    I'm trying to give my user the ability to print multiple personell badges with one swoop. I can select multiple rows from my DataGridView object, but am having trouble looping through those rows to print my data. Here is the code that I currently have that does not work...


    Code:
    For Each group As DataGridViewSelectedRowCollection In Me.dgridContractors.SelectedRows
                For Each row As DataGridViewRow In group

    I'm fairly new to VB so I'm hoping that this is an easy problem for some of you more knowledgeable developers out there. Thanks in advance.
  • Beagley
    New Member
    • Mar 2008
    • 5

    #2
    Originally posted by Beagley
    I'm trying to give my user the ability to print multiple personell badges with one swoop. I can select multiple rows from my DataGridView object, but am having trouble looping through those rows to print my data. Here is the code that I currently have that does not work...


    Code:
    For Each group As DataGridViewSelectedRowCollection In Me.dgridContractors.SelectedRows
                For Each row As DataGridViewRow In group

    I'm fairly new to VB so I'm hoping that this is an easy problem for some of you more knowledgeable developers out there. Thanks in advance.

    Turned out to be a very simple fix...

    Code:
    Dim Group As DataGridViewSelectedRowCollection = Me.dgridContractors.SelectedRows
            For Each Badge As DataGridViewRow In Group

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      You're just too quick for us. :)

      Thanks for sharing the solution, it could be helpful for others who run into similar problems.

      Comment

      Working...