private
void
gvDocuments_CellFormatting(
object
sender, CellFormattingEventArgs e)
{
if
(e.CellElement.RowIndex >= 0)
{
GridViewColumn col = e.CellElement.ColumnInfo
as
GridViewColumn;
GridViewRowInfo row = e.CellElement.RowInfo;
string
fieldName = col.Name;
if
(fieldName ==
"Id"
)
{
if
(row.Cells[
"Status"
].Value.ToString() ==
"T"
)
{
e.CellElement.ForeColor = Color.Blue;
e.CellElement.Font = font;
}
else
{
e.CellElement.ForeColor = Color.Red;
e.CellElement.Font = font;
}
}
}
}
e.CellElement.RowInfo.Cells[
"column1"
].CellElement.ForeColor
Me.RadGridView.Rows().Cells().Style.BackColor = Color.Yellow
Me.RadGridView.Rows().Cells().Style.BackColor = Color.Yellow
Me.RadGridView.Rows().Cells().Style.BackColor = Color.Yellow
Me.RadGridView.Rows().Cells().Style.BackColor = Color.Yellow
Me.RadGridView.Rows().Cells().Style.DrawFill = True
I understand that the cell element is gone but this code worked last build using the CellElement but not with the new Style object. I would assume there is a way to change the back color of a cell at run-time. Please give me the correct way so my code will work. Thank you.
OK More Info.....
Me.RadGridView.Rows().Cells().Style.ForeColor = Color.Yellow
this works!!! soooo....just maybe this is something you need to fix with backcolor.. :-)
I find it hard to believe there is no current way with the latest version to set the backcolor of cells at run-time, so any code that works I'll take at this point.
Eric