62,072
社区成员
发帖
与我相关
我的任务
分享
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
if (e.Row.Cells[4].Text == "1")
{
e.Row.Cells[4].Text = "男";
}
else if (e.Row.Cells[4].Text == "0")
{
e.Row.Cells[4].Text = "女";
}
}
catch { }
}
<asp:TemplateField>
<ItemTemplate>
<%#(Eval("sex").ToString() == "True") ? "男" : "女"%>
</ItemTemplate>
</asp:TemplateField>