ASPxGridView 怎么设置行的颜色

protected void grid_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { bool hasError = e.GetValue("FirstName").ToString().Length <= 1; hasError = hasError || e.GetValue("LastName").ToString().Length <= 1; hasError = hasError || !e.GetValue("Email").ToString().Contains("@"); hasError = hasError || (int)e.GetValue("Age") < 18; DateTime arrival = (DateTime)e.GetValue("ArrivalDate"); hasError = hasError || DateTime.Today.Year != arrival.Year || DateTime.Today.Month != arrival.Month; if(hasError) { e.Row.ForeColor = System.Drawing.Color.Red; } }

你可能感兴趣的:(object,email)