DataGridView貌似没有自动序列的功能,那么我们就通过代码在生成第一列,并为该列增加序号。
- for (int j = 0; j < this.dataGridView1.Rows.Count; j++)
- {
- dataGridView1.Rows[j].Cells[0].Value = j + 1;
- }