protected void gvList_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
for (int i = 0; i < e.Row.Cells.Count; i++)
{
e.Row.Cells[i].Attributes.Add("style", "vnd.ms-excel.numberformat: @");
}
}
}
本文介绍了一个ASP.NET中GridView控件的数据绑定方法,并通过示例代码展示了如何设置每一列的单元格格式为文本类型,确保数据显示正确。
933

被折叠的 条评论
为什么被折叠?



