I\'m thinking about implementing IEnumerable for my custom collection (a tree) so I can use foreach to traverse my tree. However as far as I know foreach always starts from
If you want to skip reading Rows in a DataGridView, try this
foreach (DataGridViewRow row in dataGridView1.Rows.Cast
If you want to copy contents of one DataGridView to another skipping rows, try this,
foreach (DataGridViewRow row in dataGridView1.Rows.Cast().Skip(3))
{
foreach (DataGridViewCell cell in row.Cells)
{
string value = cell.Value.ToString();
dataGridView2.Rows[i].Cells[j].Value = cell.Value.ToString();
j++;
}
i++;
j = 0;
}
this copies the contents from one DataGridView to another skipping 3 rows.