![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 for (int i = 0; i < this.dgvArchivesData.Rows.Count; i++) 2 { 3 if ((bool)this.dgvArchivesData.Rows[i].Cells 4 [0].EditedFormattedValue) 5 { 6 if (this.dgvArchivesData.Rows[i].IsNewRow) 7 { 8 break; 9 } 10 this.dgvArchivesData.Rows.RemoveAt(i--); 11 } 12 }