Home - Forums-.NET - FlyGrid.Net (Windows Forms) - InactiveCellBackColor when CellBackColor is set

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

InactiveCellBackColor when CellBackColor is set
Link Posted: 14-Mar-2006 00:10
Hi,

I need to find a way to color selected but inactive cells. I'm using the sylist to color nodes, however, when I dynamically set a CellBackColor for a column, then inactive cells default to the standard control color. How can I change this behavior? Can you introduce properties for InactiveBackColor, etc.?

Thanks,

Tom
Link Posted: 15-Mar-2006 02:26
FlyGrid has a
SelectedBackColor and SelectedForeColor properties to use for selected cells in the focused FlyGrid controls
and
SelectedUnfocusedBackColor and SelectedUnfocusedForeColor properties to use for selected cells in the unfocused FlyGrid controls.
You can change these properties to change displaying of cells in focused/unfocused FlyGrid control.
Link Posted: 15-Mar-2006 03:01
these properties only exist on grid level, not on column level. I need them for individual columns since they have different colors.
Link Posted: 15-Mar-2006 05:39
But you can define same properties on the column and change dci.customForeColor and dci.customBackColor in the overriden PaintCellValue(CellDrawInfo dci) procedure of this column.
Link Posted: 15-Mar-2006 05:41
ah, good idea, thanks
Link Posted: 16-Mar-2006 00:27
When a column is painted by the stylist and you set a BackColor, the stylist won't paint it anymore. Is there a way to set it back to stylist drawing?
Link Posted: 16-Mar-2006 01:07
As I've understood - you're using your own stylist,
In your stylist you can analyze context of drawing to more correctly paint background of column cells.
Link Posted: 16-Mar-2006 01:10
What I'm doing is that in general all nodes are drawn by the stylist.
However when I set an individual CellBackColor for a column that column is no longer drawn by the stylist. How can I set the column CellBackColor back so it's going to be drawn by the stylist again?
Link Posted: 16-Mar-2006 02:03
You can analyze existance of stylist in the column's PaintCellValue procedure and if stylist is existing - call base PaintCellValue procedure, and in the stylist analyze current column and use  SelectedBackColor, SelectedForeColor,
SelectedUnfocusedBackColor, SelectedUnfocusedForeColor
properties for drawing.
Link Posted: 16-Mar-2006 02:11
I think you don't understand what I want:

I have nodes drawn by the stylist. Now I press a hotkey or something and want one column to temporarily become red for example. Thus, I set grid.Columns.Items[x].CellBackColor = Color.Red.
Now the hotkey is pressed again and I want the column to return to the normal state of being drawn by the stylist without having to add a lot of code for every column to the stylist.