I have a grid (Q2 2014 SP1) with several columns and one checkbox column. The checkbox is the only information that can be modified by the users. Now, depending on the checkbox state, I paint the row using this code (where "IsConcilie" is the checkbox's column name):
if (row.Cells["IsConcilie"].Value.Equals(true))
{
rowElement.DrawFill = true;
rowElement.GradientStyle = GradientStyles.Solid;
rowElement.BackColor = Color.Gray;
rowElement.ForeColor = Color.White;
}
else
{
rowElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
rowElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
rowElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
rowElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local);
}
The problem I have is when one of the cell is clicked, the cell is selected and painted using the default colors which makes the cell hard to read because it keeps my foreground color setting.
Since only the checkbox can be modified, is here a way we can prevent the selected cell to paint using the default painting behavior? Or how can I handle the painting of the cell myself and bypass the default settings? Or even, can we make the rows non-selectable?
Thanks.