62,046
社区成员
发帖
与我相关
我的任务
分享
<asp:TemplateField HeaderText="负责人">
<ItemTemplate>
DataBinder.Eval(Container, "DataItem.f1") DataBinder.Eval(Container, "DataItem.f2")
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="要绑定的字段" HeaderText="控制" SortExpression="Auditing" />
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[3].Text == "1")
{
e.Row.Cells[3].Text = "首页显示";
}
else
{
e.Row.Cells[3].Text = "<font color=red>已审核</font>";
}
}
}
select f1,f2,(case f3 when 1 then '首页显示' when 2 then '审核通过' end) as f3 from tab