如何在gridview中改变单个单元格的颜色..?
protected void gv_transaction_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[6].Text == "Cancelled")
{
e.Row.Cells[6].ForeColor = System.Drawing.Color.Red;
}
}
答案 0 :(得分:0)
e.Row.Cells[6].Style.ForeColor = Color.Red;