I am able to change the font but not the backcolor. The line that sets the color is indeed being executed (e.RowElement.BackColor = ....) but the color does not change. What am I failing to do?
void
grid_RowFormatting(
object
sender, Telerik.WinControls.UI.RowFormattingEventArgs e)
{
try
{
if
((grid.MasterTemplate.Columns.Contains(
"colARRIVE"
)) && (grid.MasterTemplate.Columns.Contains(
"colDEPART"
)))
{
if
((TimeSpan)e.RowElement.RowInfo.Cells[
"colARRIVE"
].Value == (TimeSpan) e.RowElement.RowInfo.Cells[
"colDEPART"
].Value)
{
e.RowElement.Font =
new
Font(e.RowElement.Font, FontStyle.Strikeout);
}
else
{
e.RowElement.Font =
new
Font(e.RowElement.Font, FontStyle.Regular);
}
}
if
(e.RowElement.RowInfo.Cells[
"colSRC"
].Value.ToString() ==
"O"
)
{
e.RowElement.BackColor = System.Drawing.Color.AliceBlue;
}
}
catch
(Exception ex)
{
}
}