Reputation: 24731
foreach (DataGridViewRow item in this.dataGridView1.SelectedRows)
{
if (Int32.Parse(item.Cells[1].Value.ToString()) >= Int32.Parse(textBox4.Text) )
{
dataGridView1.Rows.RemoveAt(item.Index);
}
}
I'm trying to check if the integer in the second column is at least the value in textBox4. However, nothing is removed when I run this, so I feel it's not comparing the right column.
Do C# columns count from 0 or from 1?
Upvotes: 2
Views: 5135