public void ShowIndex(DataGridView dgv)
{
for (int i = 0; i < dgv.Rows.Count; i++)
{
dgv.Rows[i].HeaderCell.Value = (i+1).ToString(); //HeaderCell获取或设置行的标头单元格
}
}
时间: 2024-10-15 20:26:32