473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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...


Expand|Select|Wrap|Line Numbers
  1. For Each group As DataGridViewSelectedRowCollection In Me.dgridContractors.SelectedRows
  2.             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.
Mar 13 '08 #1
2 1692
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...


Expand|Select|Wrap|Line Numbers
  1. For Each group As DataGridViewSelectedRowCollection In Me.dgridContractors.SelectedRows
  2.             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...

Expand|Select|Wrap|Line Numbers
  1. Dim Group As DataGridViewSelectedRowCollection = Me.dgridContractors.SelectedRows
  2.         For Each Badge As DataGridViewRow In Group
Mar 13 '08 #2
Killer42
8,435 Expert 8TB
You're just too quick for us. :)

Thanks for sharing the solution, it could be helpful for others who run into similar problems.
Mar 14 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Dan | last post by:
I'd like to loop through selected datagrid rows and extract specified columns from those rows. How would I do that? Thanks... Dan
1
by: MrNobody | last post by:
what I'd like to have is a simple feature to search within a column in a DataGrid and have that the first matching row selected, then the user can choose to search again where it will select the...
2
by: bill yeager | last post by:
I need to get the SelectedValue of each item selected in a multi-selection listbox. I have the following code, but it just returns me the SelectedValue of ONLY the first item selected in the list:...
5
by: magmo | last post by:
Hi I have a datagrid that have checkboxes added to it and there is also a button that I want to use as a check what rows has been selected in the datagrid. But when I use this piece if code...
7
by: Ken | last post by:
Hi All - I have a filtered GridView. This GridView has a check box in the first column. This check box is used to identify specific rows for delete operations. On the button click event I...
0
by: yeltsin27 | last post by:
I need some advice on handling dynamically added controls in a GridView. My app takes an uploaded CSV file containing addresses, converts it to a DataTable, databinds the DataTable to a...
8
by: Izzy | last post by:
I'm writting an app that has two DataGridViews, in the first grid I load a list on companies. Between the 2 grids are two buttons with arrows, one points to the right the other to the left. When...
0
by: Vincent | last post by:
I have a large list box with the multiselect property turned on and a vertical scrollbar. For every row that is selected, a designated document prints out. If the document successfully prints, I...
4
by: svgeorge | last post by:
I NEED TO COLLECT FROM THE GRIDVIEW(DATASELECTED) IN TO A TABLE(SelectedPayment) -------------------------------------------------------------------------------- How TO COLLECT THE ROWS...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.