<pre lang="c#"> private void buttonDeleteRow_Click(object sender, EventArgs e) { foreach (DataGridViewRow row in this.dataGridView1.SelectedRows) { if (!row.IsNewRow) { this.dataGridView1.Rows.RemoveAt(row.Index); } } }
foreach (DataGridViewRow row in dataGridView1.Rows) { if (!row.IsNewRow) { row.Cells["Item"].Value = row.Index+1; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)