protected void btnClick(object sender, EventArgs e) {
string ids = String.Empty;
foreach (DataRowView drv in DataGridView1.Rows) {
if (drv[0].Checked) {
ids += drv["rezerveID "];
}
}
}
You might consider keeping checked row indexes collection on CheckBoxCellClick (use CellContentClick or checkedChange or some such). In that case you're not iterating through all rows in the grid like the above code, but you're introducing at least one more object (collection), event (checkedChanged) and logic for adding and removing the items.
I would go with simpler solution.
If this helps please take time to accept the solution. Thank you.