Me.DataGrid1.Columns(0).ItemStyle.BorderColor = Color.AntiqueWhite
解决方案 »
- 50分问个问题2个不同程序怎么共用
- 动态LinkButton不管用,这是我写的大家看一下啊,请指教.
- 页面中文字逆时针旋转90度怎么实现,各位大侠,帮帮新手小弟!
- asp与asp.net 同一服务器运行兼容问题
- 关于Head请求的问题
- 当数据库中某个字段的值为空的时候应当用if()语句怎么判断?
- 怎样在asp.net中使用摄像头拍照?
- 极其简单的问题
- 如何在录入文字的同时加上这样的功能。
- 问一个正则表达式的符号
- 一个datatable里有10个字段,绑到datagrid时,让它只显示其中5个(其余的另有别的用处),应该怎么处理啊,不要在datagrid里加隐藏列
- 显示总是停留在首页?????到下一页咋办?????
<asp:TemplateColumn HeaderText="性别">
<ItemTemplate>
<asp:Label runat="server" ForeColor='<%# GetColor(DataBinder.Eval(Container, "DataItem.sex").ToString()) %>' Text='<%# GetValue(DataBinder.Eval(Container, "DataItem.sex").ToString()) %>' ID="Label1">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
cs
protected Color GetColor(string sex)
{
Color temp;
if(sex=="0")
temp=Color.Red;
else if(sex=="1")
temp=Color.Blue;
else
temp=Color.Black;
return temp;
}
{
if(Convert.ToInt32(OffThingList.Items[i].Cells[2].Text) >= Convert.ToInt32(OffThingList.Items[i].Cells[6].Text))
{
OffThingList.Items[i].ForeColor = Color.Red;
}
}
我这个是判断当一列的值大于另一个列时,让这个列变成红色!可以实现