Solved

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

Posted on 2013-01-10
3
369 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 500 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 500 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

735 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