如何根据不同值改 DataGridView 行背景色。
----------------------------- 
 1               是         张三         男 
 2               否         李四         女    
 3               是         王二         男 
 4               否         麻子         男 
 -----------------------------     
 如何将性别为男的行颜色改成红色? 
------解决方案-------------------- <asp:TemplateField HeaderText = "操作区 ">  
                                  <ItemTemplate>  
                                     <div style= "background-color: <%# DataBinder.Eval(Container, "DataItem.Sex ").ToString()== "男 "? "red ": "blue " %>   "   
                                     </div>  
                                  </ItemTemplate>  
                             </asp:TemplateField>
------解决方案--------------------  ItemDataBound事件里 
 if (e.Item.Cells[性别列的索引值].Text ==  "男 ") 
        e.Item.BackColor = System.Drawing.Color.Red; 
 if (e.Item.Cells[性别列的索引值].Text ==  "女 ") 
        e.Item.BackColor = System.Drawing.Color.Blue;
------解决方案--------------------我觉得在邦定事件里面写会不会好些!
------解决方案--------------------你可以CellPainting处理这个事件,示例如下:   
 private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) 
 { 
 	if (e.Value== "男 ") 
 	{ 
 		e.PaintBackground(e.CellBounds, true); 
 	} 
 }
------解决方案--------------------学习学习~