if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) ... { //IsEdit为true表示有编辑权限,为false表示有只读权限 bool IsEdit; //时间格式处理 System.Web.UI.WebControls.Literal lblTime = (Literal)e.Item.Cells[2].FindControl("lblTime"); lblTime.Text = Convert.ToDateTime(lblTime.Text.Trim()).ToString("yyyy-MM"); Label LblCityTeamCode = (Label)e.Item.Cells[4].FindControl("LblCityTeamCode"); Label LblExecutiveTeamCode = (Label)e.Item.Cells[5].FindControl("LblExecutiveTeamCode");}