您的位置:首页 > 其它

Gridview TemplateField 显示日期

2010-05-14 09:21 183 查看
方法一:

代码

protected void xxxxx_RowDataBound(object sender, GridViewRowEventArgs e)
{
InsusDateTimeUtility objInsusDateTimeUtility = new InsusDateTimeUtility();
DataRowView drv = (DataRowView)e.Row.DataItem;

if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.FindControl("LabelInspectionDate") != null)
{
Label labelInspectionDate = (Label)e.Row.FindControl("LabelInspectionDate");
labelInspectionDate.Text = objInsusDateTimeUtility.GetDateTime(drv["InspectionDate"], "yyyy-MM-dd");
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐