Solved

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

Posted on 2013-01-10
3
371 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

How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

627 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