在VS.net 2005(ASP.NET 2.0) 中为GridView加行序的方法

在VS.net 2005(ASP.NET 2.0) 中为GridView加行序的方法:
 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if(e.Row.RowIndex >= 0)
        {            ((Label)e.Row.Cells[2].FindControl("Label2")).Text = Convert.ToString

(e.Row.DataItemIndex + 1);
      }
    } 

你可能感兴趣的:(object,asp.net)