Hello everybody
I'm using Telerik RadGridView. I'm trying to change the color of one cell depending on the value of another cell. I'm trying to achieve this using this code:
if (e.Column.Name == "colDate" && !string.IsNullOrEmpty(e.CellElement.Value.ToString()))
{
if (DateTime.Now > DateTime.Parse(e.CellElement.Value.ToString()))
{
e.Row.Cells["colColor"].Style.DrawFill = true;
e.Row.Cells["colColor"].Style.BackColor = Color.Red;
e.Row.Cells["colColor"].Style.NumberOfColors = 1;
}
}
But for some reason it doesn't change the color. What I noticed is that when i replace
"e.Row.Cells["colColor"].Style"
with
"e.CellElement"
it changes the color. But I don't want to change the color of the current cell. I want it to change the color of another cell.
Any suggestions? :)
I'm using Telerik RadGridView. I'm trying to change the color of one cell depending on the value of another cell. I'm trying to achieve this using this code:
if (e.Column.Name == "colDate" && !string.IsNullOrEmpty(e.CellElement.Value.ToString()))
{
if (DateTime.Now > DateTime.Parse(e.CellElement.Value.ToString()))
{
e.Row.Cells["colColor"].Style.DrawFill = true;
e.Row.Cells["colColor"].Style.BackColor = Color.Red;
e.Row.Cells["colColor"].Style.NumberOfColors = 1;
}
}
But for some reason it doesn't change the color. What I noticed is that when i replace
"e.Row.Cells["colColor"].Style"
with
"e.CellElement"
it changes the color. But I don't want to change the color of the current cell. I want it to change the color of another cell.
Any suggestions? :)