Hi,
I am using a RadGridView to display user values related to each others in multiple ways.
I wish to periodically scan all cells to check the values and then flag them with a red or green cell border.
I keep all the cells status in a Dictionary<point, status> with point being the cell coordinates.
However, Idon't find a way to have all cells with a reference in the dictionary permanently showing the right border depending on its status.
I am using the cell_formatting event, but the border color disappear when cell is not current.
Here is some sample code
private void gvLignesFacture_CellFormatting(object sender, CellFormattingEventArgs e)
{
// On décore la cellule selon son status
Point cellCoordinates = new(e.CellElement.RowIndex, e.CellElement.ColumnIndex);
if (DictOfGvCellStatusByCoordinates.TryGetValue(cellCoordinates, out var lookStatus))
{
switch (lookStatus)
{
case CtrlLook.Default:
e.CellElement.Font = GlobalVars.smallRegularFont;
e.CellElement.BorderColor = Color.Black;
break;
case CtrlLook.Valid:
e.CellElement.Font = GlobalVars.smallBoldFont;
e.CellElement.BorderColor = Color.Green;
break;
case CtrlLook.Incorrect:
e.CellElement.Font = GlobalVars.smallRegularFont;
e.CellElement.BorderColor = Color.Red;
break;
}
}
}
How to do this right ?
Many thanks for your answer
Patrick