如何改变datagrid中单个字符的颜色??
如何改变datagrid中单个字符的颜色??比如某格是“123456”
我要将2变成红色,怎么办?
”1<font forecolor=red>2</Font>3456“貌似不行 --------------------编程问答-------------------- 如果是<asp:BoundField>
protected void GridView1_DataBound ( object sender, EventArgs e )
{
foreach ( GridViewRow row in GridView1.Rows )
{
row.Cells [ 0 ].Text = row.Cells [ 0 ].Text.Replace("2","<font color='red'>2</font>");;
}
}
如果是<asp:TemplateField>
<asp:TemplateField HeaderText="Hehe">
<ItemTemplate>
<asp:Label ID="Hehe" runat="server" Text=<%#Eval("job_id").ToString().Replace("2","<font color='red'>2</font>")%>></asp:Label>
</ItemTemplate>
</asp:TemplateField> --------------------编程问答-------------------- 好像不行哎 --------------------编程问答-------------------- 其他办法??
补充:.NET技术 , C#