Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15549

[RESOLVED] get rows from DataGridViewRowCollection

$
0
0
Hi.
Normally I would do this to get specific rows:
Code:

For Each row As DataGridViewRow In DataGridView1.Rows.Cast(Of DataGridViewRow).Where(Function(x) x.Cells("Online").Value = True )
...add to something

Is there a way to skip the loop and add the datagridviewrowcollection based on a filter?

Something like:
Dim dgrv As New DataGridViewRowCollection(DataGridView1.Rows.Cast(Of DataGridViewRowCollection).Where(Function(y) y.Cast(Of DataGridViewRow).Where(Function(x) x.Cells("Online").Value = True)))

?

That is educational, ideally I would like to add, without a loop, filtered rows - specific cell value to a listof(string) . Is that possible?

Thanks.

Viewing all articles
Browse latest Browse all 15549

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>