Hello.
I've an UltraGrid which I specify a BackColor for each cell, and it changes depending some things of the system. So, I've set in my isl file for the UltraGridRow and UltraGridCell in the states: normal, active, selected and hottracked the backcolor as transparent.
I'm having two problem:
When I click some cell all the cells in the row changes its BackColor to white. I've "solved" adding this code to the end of CellClick event:
foreach (UltraGridCell cell in e.Cell.Row.Cells){ cell.ActiveAppearance = cell.Appearance; cell.SelectedAppearance = cell.Appearance;}
but it makes a blinking between white BackColor and the right one.
My second problem: on the mouse over event of a cell it puts its BackColor as white, no motter I've set UltraGridCell -> HotTracked -> BackColor as white.
Thanks for the help.
Diego
Hi Diego,
I'm not sure I understand what you are trying to do here.
Why are you using Color.Transparent? Transparent will not mean that the cells and rows do not apply a BackColor, it means that they will explicitly apply a color of Transparent, so they will be see-through.
If you don't want your grid to show any special colors for the ActiveRow, then what you should do is set up your isl such that the BackColor on the Active state of the row/cell is not set to anything.
And the same goes for HotTracked and Selected.
Now... selected is a little different, because the grid has built-in selected colors by default. To turn these off, you would have to do something like this:
this.ultraGrid1.DisplayLayout.Override.SelectedAppearancesEnabled = DefaultableBoolean.False;
Note that there is a similar property for Active, but it generally makes more sense not to apply an active appearance in the first place then to apply one and then switch it off.
this.ultraGrid1.DisplayLayout.Override.ActiveAppearancesEnabled = DefaultableBoolean.False;
Mike thanks for the reply!
I remove all the different sates from the isl, I was misunderstanding "Transparent".
Now I've set the SelectedAppearancesEnabled as DefaultbleBoolean.False, as you said, but I'm still getting the blue (selected) back color in all the cells of current row.
In case you haven't understand what I'm looking for:
I set at the beginning a BackColor for each cell in the grid. I want that color to never be overwritten, it should always be the cell's color.
Also: removing the ISL worked to avoid the white back color in mouse over.
I'd to set both: SelectedAppearancesEnabled and ActiveAppearancesEnabled to DefaultbleBoolean.False to make it work.
If neither of those properties is working, then something in your code or in your isl must be applying those colors as something other than an active or selected appearance.
Or... SelectedAppearancesEnabled or ActiveAppearancesEnabled are getting reset back to their defaults after you set them.
I think I didn't explain myself. After I set both properties to False, it worked as wanted.
Thanks!