Traverse all rows in a DataGridView

1

I have this for:

For Each DataGridViewRow In F_Principal.DataGridView2.Rows

How do I select row by row? Is there any way to see how many times it has been repeated?

    
asked by anonymous 02.02.2016 / 10:38

1 answer

1

I was able to respond on my own, but I leave the answer here for anyone.

For Each lel As DataGridViewRow In F_Principal.DataGridView2.Rows
       MsgBox("Index : " & lel.Index)
Next

The variable "lel" is going to be the current line, and you can take whatever infos you want.

    
02.02.2016 / 10:47