ฉันมีปัญหากับ onDataRowBound ดูเหมือนว่าจะใส่สีให้กับทั้งคอลัมน์ของเซลล์[0] เซลล์อื่นๆ มีค่าอยู่แต่ยังคงให้สีแก่เซลล์ของฉัน นี่คือรหัสของฉัน
protected void GridUserMessage_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (String.IsNullOrWhiteSpace(e.Row.Cells[0].Text))
{
e.Row.BackColor = System.Drawing.Color.Red;
}
}
}
เกิดอะไรขึ้นกับเรื่องนี้?