As the subject indicates, I have a DevComponents DotNetBar SuperGridControl (SGC) on my Windows Form. In that SGC, I have alternating row colors. One of the columns in the SGC has boolean values (enabled/disabled flag in the data).
I would like to change the background color of JUST the rows that are marked with a false boolean value.
The code I've attempted to use to perform this task:
private void dgvSearchResults_PostRenderRow(object sender, GridPostRenderRowEventArgs e)
{
if (e.RenderParts != RenderParts.Background) { return; }
var row = (GridRow)e.GridRow;
if (((CustomerDTO)row.DataItem).Disabled)
{
//Try to figure out how to set the row color here.
}
}
The nasty part of this is that this code apparently runs twice for every row in the SGC. But, that part aside, there doesn't seem to be any way to change the row color of the row that I'm in when I get into the .Disabled control statement.
I'd love any tips or suggestions.