gridview某行颜色根据数值而变化
在gridview的RowDataBound()事件中:
If e.Row.RowType=DataControlRowType.DataRow Then
Dim unitsInstock As Integer=Convert.ToInt32(DataBinder.Eval(e.Row.DataItem,”UnitsInStock”))
if unitsInstock=0 then
e.Row.BackColor=Drawing.Color.Yellow
end if
end if
Eval():
取得数据容器中某列的值