Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Use vb.net grid control with ability to check rows and loop through

Posted on 2013-01-10
3
Medium Priority
?
376 Views
Last Modified: 2013-01-24
Hi everyone,  I want to use the grid control in vb.net.  It will be bound to a dataset.  I need a way to click on multiple rows perhaps selecting a check box.  

When a user clicks a button on the form, I will loop through the selected rows and execute some code.

Can anyone help!
0
Comment
Question by:jwebster77
  • 2
3 Comments
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 2000 total points
ID: 38765016
Set the MultiSelect property of grid to true, then use CTRL or SHIFT keys and click to select multiple rows. On button click, loop through the SelectedRows property of the grid.
0
 

Author Comment

by:jwebster77
ID: 38765749
Do you have any code example for looping?
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 38766321
Its a simple loop

For i As Integer = 0 to grid.SelectedRows.Count-1
    Msgbox grid.SelectedRows(i).Cells(0).Value
Next
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question