Gridview’da satır içi değere bakıp farkı arka plan rengi verme olayı
protected void GrdFaaliyetler_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string al = e.Row.Cells[9].Text;
if (!string.IsNullOrEmpty(al))
{
if (al == “false” || al == “False”)
e.Row.BackColor = System.Drawing.Color.Red;
}
}
}
Diğer satır özelliklerini değiştirmek için;
if (e.RowType == GridViewRowType.Data)
{
if (((ASPxGridView)sender).GetRowValues(e.VisibleIndex, “distFillStatus”).ToString() == “REJECTED”)
{
e.Row.BackColor = System.Drawing.Color.Red;
e.Row.ForeColor = System.Drawing.Color.White;
//e.Row.Font.Size = 15;
//e.Row.Font.Bold = true;
//e.Row.Attributes.Add(“style”, “background-color: red; fore-color: white;”);
}
}