添加 行

dataGridView1.Rows.Add();//添加空行

 dataGridView1.Rows.Add("a","b"……);//添加指定列数的行

 

删除 行

dataGridView1.Rows.Remove(dataGridView1 .CurrentRow);//删除当前光标所在的行
dataGridView1.Rows.Remove(dataGridView1.Rows[0]);//删除指定行数的行
dataGridView1.Rows.Remove(dataGridView1 .Rows [ dataGridView1 .Rows .Count -1]);//删除最后一行
dataGridView1.Rows.Clear();//删除所有行

 

相关文章:

  • 2022-02-04
  • 2022-02-09
  • 2022-12-23
  • 2021-11-29
  • 2021-09-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-15
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案