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,
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.
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?
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.
Hi Mike,
it still doesn't work. I attached an image to show what happens. I forgot to say that we load a style when the apps opens (Aero.isl) with the StyleManager. It is loaded after I set the properties discussed early.
In the image attached, the selected row has a fat border around it. It appears because I set SelectionOverlayColor. As you can see, the cell Status with the text "Not validated" is supposed to be the same color as the other rows.
FrancisVital said:I forgot to say that we load a style when the apps opens (Aero.isl) with the StyleManager. It is loaded after I set the properties discussed early.
That's why it's not working, then. Your isl file is setting a BackColor on the selection. You need to turn that off in the isl or else do this:
band.Override.SelectedAppearancesEnabled = DefaultableBoolean.False;
Effectively, if I don't load style and only if I add these lines in the InitiliazeLayout event :
DisplayLayout.SelectionOverlayColor = SystemColors.Highlight;DisplayLayout.SelectionOverlayBorderColor = SystemColors.Highlight;DisplayLayout.SelectionOverlayBorderThickness = 1;
Then it works. But I want that the style is loaded and I don't want to edit the isl directly. So I try your line :
DisplayLayout.Bands[0].Override.SelectedAppearancesEnabled = DefaultableBoolean.False;
But it still doesn't work ... :( I really do not understand why. I tried a lot of things.
Hi Mike!
It works, finally! thank you very much for your help. It was really appreciated.
Try setting ActiveAppearancesEnabled to false, in addition to SelectedAppearancesEnabled.