Hi!
We configured at loading time some conditonnal formatting on columns of the grid. It works great. The formatting set cell back color.
But if the row is selected then the selected row appearance is taken instead of the valuebased appearance. Is there any way to show the correct back color even if the row is selected ?
Best regards,
Benoit
Hi Benoit,
You don't need to set the BorderColor, just the SelectionOverlayColor is enough. This makes the selection of rows and cells appear as a semi-transparent overlay, so you will still be able to see the colors of the cells underneath it.
What exactly is not working? Are you saying you are setting the SelectionOverlay color and the selection is still changing the BackColor on every cell in the row?
If that's what you are saying, then my only guess is that your grid is also applying an ActiveRowAppearance. In which case, this should help:
FAQ:How do I turn off the ActiveRowAppearance so that the active row in the grid does not appear selected.
thanks for your answers but it doesn't work. I tried with :
DisplayLayout.SelectionOverlayColor =
SystemColors.Highlight;
DisplayLayout.SelectionOverlayBorderColor =
DisplayLayout.SelectionOverlayBorderThickness = 1;
It puts a large rectangle around each selected cell or selected row. So I put SelectionOverlayBorderThickness to 1 but I still cannot see my back color. also it now puts a different border color when the cell is selected but it is not the one the represent the back color. Don't know why.
Any other ideas?
Try this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; layout.SelectionOverlayColor = SystemColors.Highlight; }
This will make the selection work like an overlay (like MS Excel) instead of changing the color of the cells directly. This way your users will be able to see both the selection and the ValueBasedAppearance.
You can set the UltraGrid.DisplayLayout.SelectionOverlayColor/SelectionOverlayBorderColor properties to depict selection in such a way as to not draw over the other appearances. Typically you set SelectionOverlayColor to a semi-transparent color, and the row is washed with that color when it is selected, chamging but not covering whatever other colors are in effect for the row.