在DataGrid的ItemDataBind事件里写,
if((e.Item.Cells[6].Text)=="男")//假设性别字段在第6行
e.Item.BackColor=Color.Blue;
if((e.Item.Cells[6].Text)=="女")
e.Item.BackColor=Color.Red;
但我的却是e.Item.Cells[6].Text却是""
if((e.Item.Cells[6].Text)=="男")//假设性别字段在第6行
e.Item.BackColor=Color.Blue;
if((e.Item.Cells[6].Text)=="女")
e.Item.BackColor=Color.Red;
但我的却是e.Item.Cells[6].Text却是""
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货