how to put gridview selected row color conditionwise?
like
string x = e.Row.Cells[8].Text.ToString();
string y = e.Row.Cells[7].Text.Trim();
if (x> y)
{
//those row color are red;
}
else
{
//those row color are blue;
}
Loading
Iftikar HussainPosted Aug 22, 2013, 3:24 AM
You can use GridViewRowDataBound for setting selected row color
in your aspx
in your code
string x = e.Row.Cells[8].Text.ToString();
string y = e.Row.Cells[7].Text.Trim();
e.Row.BackColor = System.Drawing.Color.Red;
}
else
{
e.Row.BackColor = System.Drawing.Color.Blue;
}
Regards,
Iftikar
Vishwas KadamannayaPosted Aug 22, 2013, 3:20 AM