我要的效果 
  序号    名称    
   1      aa
   2      bb
   3      cc  
   4      dd
   5      ee
删除cc后效果如下
   序号
   1      aa
   2      bb
   3      dd
   4      ee
删除 cc  aa  效果如下
   1      bb
   2      dd
   3      ee

解决方案 »

  1.   

    获得当前行的index+1就可以了
      

  2.   

    <asp:TemplateField HeaderText="序号">
        <ItemTemplate>
              <%#Container.DataItemIndex+1 %>
        </ItemTemplate>
     </asp:TemplateField>
      

  3.   

    /// <summary>
    /// 重新设置序号
    /// </summary>
    /// <param name="listView"></param>
    /// <param name="startIndex"></param>
    public static void ResetSEQ(DataGridView dataGridView, int startIndex)
    {
    for (int i = startIndex; i < dataGridView.Rows.Count; i++)
    {
    dataGridView.Rows[i].Cells[0].Value = (i + 1).ToString();
    }
    }