Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Iterating through Datagridview

$
0
0

Hi folks,

I have a datagridview where all the rows (around 200) have been selected (I have clicked on the upper left corner).

I then want to process each row so I use :

foreach (DataGridViewRow r in d.SelectedRows) { // do stuff...

d.Rows.Remove(r) }

The trouble is that it process them from the bottom of the grid first and works its way up the top.

Ideally, I would like the for each loop to start at the top of the datagridview. I am removing the each row after I have processed it but it takes a while before it gets up to the topmost rows and looks like nothing is happening.

J


jppnn


Viewing all articles
Browse latest Browse all 2535

Trending Articles



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