2013-05-29 209 views

回答

1

希望这将有助于....

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 
{ 
    if(e.Row.RowType == DataControlRowType.DataRow) 
    { 
if(e.Row.Index=1) //Check your Row index 
    { 
     e.Row.Cells[YOur column index].Attributes.Add("Style", "background: url(../Images/nc.png) no-repeat 5px center;"); 
    } 
} 
} 
+0

谢谢你,但此设置图像的整行。我想更改特定单元格的背景。第三行和第六列中存在的单元格 – focus

相关问题