I have an Ultragrid which display things with backcolor depending on situation...
When I try to print, in the print preview, I got this (which is the same I got if I do print)...
So, question is simple : What should I do in order to get the same result as what I see when "consulting" the grid as normal...
If you are using an isl file (like nautilus), then that will certainly have an effect. There might be some other alpha-blending already taking place on the row, so maybe that's why the color is not working.
It's really hard to say since there are so many factors involved. If you could create a small sample project that demonstrates the printing issue, I'm sure I could debug it and tell you exactly what's going on and how to fix it. But without a sample, all I can really do is take wild stabs in the dark.
the blue is because of the selection
but other rows are not pink as they should due to the code you told me to test.
I haven't done lot of customisation in the grid... really no color set up or anything like that.
Maybe it's coming from the style I'm using ? I'm using Nautilus Style... (through the UltraFormManager component).
So, there is no explanation to my problem ?
Well, that's odd. Why it is it blue?
There must be some other settings involved here, like maybe that row is selected and the selection is using an overlay color that is mixing with the pink. That shouldn't affect printing, though, since the printed grid won't have any selected rows.
Well, if I only do this :
if(e.Row.Cells["Process"].Value.ToString() != "OK") { e.Row.Appearance.BackColor = Color.Pink; }
I get the picture attached... not really pink isn't it ?
nicolas etienne said:well, If I remove the Alphalevel, the cell is not longer colored with the color.. (well the background is not colored as expected).
Sorry... what does that mean, exactly? Is the row colored or not? Or are you saying it's red instead of pink?
Does removing the AlphaLevel fix the printing issue?
There's nothing wrong with this code, but I don't know if the printer can support alpha blending. If you just want the rows to be pink, why don't you set the BackColor to pink instead of Red? That will be a lot more efficient than using AlphaBlending to mix red with the BackColor.