dataGridView的RowPostPaint事件,双击,吧下面的代考进去,改下dataGridView名字,就ok
private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
foreach (DataGridViewRow dr in dataGridView1.Rows)
{
dr .Cells[0].Value = dr .Index+1;
}
}