C#DataGridView的简单使用

首先创建一个DataGridView控件,然后创建列(包括列名的定义),

由于我不是和数据库进行连接,只是为了输出好看一点。

删除所有数据:

while (this.dataGridView1.Rows.Count != 0)
            {
                this.dataGridView1.Rows.RemoveAt(0);
            }

添加一行数据:

index = this.dataGridView1.Rows.Add();//获取新的一行

           

相关文章:

  • 2022-12-23
  • 2022-01-20
  • 2022-01-16
  • 2021-04-14
  • 2021-09-16
  • 2022-02-02
  • 2021-10-25
猜你喜欢
  • 2022-12-23
  • 2022-02-18
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
  • 2021-06-20
相关资源
相似解决方案