473,809 Members | 2,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need advice on looping through selected rows for printing

5 New Member
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 1738
Beagley
5 New Member
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 Recognized Expert Expert
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
35483
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
1257
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 next matching row. I would love a syntax where it can accept wildcards, i.e. search item name for '%red%' to search for anything that has the word 'red' anywhere within it. So far my only solution was to create a new DataView for each search...
2
2167
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: Dim liGroup As ListItem For Each liGroup In lstGroups.Items
5
1430
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 the program just close when I press the button that is supposed to show the selected rows in the datagrid <code>
7
5475
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 loop through the filtered GridView to identify the selected rows and assemble some XML to be sent to a stored proc. The problem I have is that when looping through the GridView, it doesn't
0
1890
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 GridView, accepts information via dropdowns embedded in the first row of the GridView about which incoming fields should go to which database fields, and writes the data to the database. The incoming data has an arbitrary number of columns so I create...
8
1820
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 the user selects rows from grid 1 (on the left) and clicks the arrow pointing to the right, it moves the rows to the other DataGridView. The user is basically selecting companies to print out invoices for. The grid on the right is the list of...
0
1847
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 unselect that particular row. For this to work properly, I have to print from the bottom up due to the nature of the itemsselected collection. I am also unselecting rows to indicate the progression of the printing. Is it possible to ensure...
4
1981
by: svgeorge | last post by:
I NEED TO COLLECT FROM THE GRIDVIEW(DATASELECTED) IN TO A TABLE(SelectedPayment) -------------------------------------------------------------------------------- How TO COLLECT THE ROWS CHECKED IN CHECK BOX IN THE DATASELECTED TO ANOTHER GRID VIEW ON CLICLING BUTTON I NEED TO COLLECT FROM THE GRIDVIEW(DATASELECTED) IN TO A TABLE(SelectedPayment) SIMILLAR TO HOTMAIL MODEL.....CHECK THE MAILS AND BRING THE CHECKED DATA TO ANOTHER PAGE
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10391
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10121
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.