Hi.
I am trying to make the background of an UltraGrid become either transparent or control it's opaque level. I've tried different things, but nothing seems to work (except setting the AlphaLevel - but that only makes it darker). The background always come out white (both where rows are present and below). Even the following don't have an effect!
grid.DisplayLayout.Appearance.BackColor = Color.Green;
How do I set the Opaque level if I set the BackColorAlpha as shown below?
grid.DisplayLayout.Appearance.BackColorAlpha = Alpha.Opaque;
Hykkel
Hi Hykkel,
Hykkel said:Even the following don't have an effect! grid.DisplayLayout.Appearance.BackColor = Color.Green;
If this has no effect, then something must be overriding it. My guess is that you are loading a layout, preset or StyleLibrary that is overriding the property settings.
THX alot Mike.
Found the override!
Hi,
I've got the same problem. Easily setting the color isn't working.
How did you override the override? :)
Thanks, Christoph
Hi, Christoph
What I found was, that the following was overridden another place in the code (now changed to the following). Hope this will help you.
grid.DisplayLayout.Appearance.BackColor =
Color.Transparent;
grid.DisplayLayout.Appearance.BorderColor =
grid.DisplayLayout.Override.CardAreaAppearance.BackColor =
/Hykkel
Thanks Hykkel,
but I've already tried to set the background this way - doesn't work. In the PrintPreviewDialog no changes are shown or printed.
Hmm.. So the problem lies in the PrintPreviewDialog. I presume you make a UltraGridPrintDocument and set the grid to your grid. My guess is that when you do this the document has an override for the property.
I am no expert in this, so I must ask you to write to e.g. Mike (see earlier reply). My guess is that you have to design the document and set the property after the grid is set... somehow?
Sorry I can't be of more assistance
no the problem wasn't in the PrintPreviewDialog.
As Mike metnioned before a style was overriding the background for the grid - even in the print view.
Defining a new style (or using another style that's defining white background) and setting the grids style to this one makes the background white. So for all having the same problem:
UltraGrid1.StyleLibraryName = "LibraryName"
could help you out.
Thanks for your help...