looping through datagrid view anf finding a condition
Hello
I am using VB.NET 10.Is it possible to loop through a datagridview,find a certain value in a column and then produce the next row down.
For example lets say I was looping through the following datagrid.
Name Hobby FavColour job
fred eating blue plumber
berty movies red teacher
nancy gardening white gardener
horace kite flying yellow plasterer
When I reach a certain value in a cell(column) lets say movies(bert's hobby) I would like to then be able to display the NEXT row down,here it would be the Nancy Row.Any help much appreciated.
Custard
Re: looping through datagrid view anf finding a condition
Yes, of course it's possible. Just use a For loop. Loop through the Rows of the grid in your For loop and, when you find a row of interest, you simply get the row at the next index, display it and then exit the loop.
Re: looping through datagrid view anf finding a condition
Hi jmcilhinney.Thanks for your reply.So how is it done then,because I dont know. :)