mrhe
(Mariusz Hermansdorfer)
March 26, 2024, 9:23pm
1
Hey Developers!
Has anyone figured out how to change the background color of an Eto TreeGridView?
The obvious doesn’t do anything:
var treeGridView = new TreeGridView
{
Width = -1,
ShowHeader = false,
AllowColumnReordering = false,
BackgroundColor = Eto.Drawing.Colors.Red
};
Nor does this work:
Eto.Style.Add<TreeGridView>(null, c => c.BackgroundColor = Eto.Drawing.Colors.Red);
The closest I can get is changing the colors of individual cells but that’s not the effect I’m after:
private static void TreeGridView_CellFormatting(object sender, GridCellFormatEventArgs e)
{
e.BackgroundColor = Eto.Drawing.Colors.Red;
}
Any suggestions? @curtisw , @dale
mrhe
(Mariusz Hermansdorfer)
March 26, 2024, 9:28pm
2
Ah, found it!
private static void TreeGridView_LoadComplete(object sender, System.EventArgs e)
{
((TreeGridView)sender).BackgroundColor = Eto.Drawing.Colors.Transparent;
}
mrhe
(Mariusz Hermansdorfer)
April 11, 2024, 8:01am
3
The above only works in Rhino 7, Rhino 8 overrides this with a default value related to the color mode:
Dark Mode:
Light Mode:
@curtisw , do you have any suggestions on how to address this?
curtisw
(Curtis Wensley)
April 16, 2024, 5:09pm
4
@mrhe Do you have steps that I can use to replicate the issue? Now that you’ve sent me the project I can try it but I didn’t see this issue when I was looking at it.
mrhe
(Mariusz Hermansdorfer)
April 16, 2024, 7:47pm
5
@curtisw , in the project I sent you, under Controls, you’ll find the LayerSelector
class:
Try changing the background color of the control. I’ve found that the following was the only way to get it to work in Rhino 7:
Rhino 8, however, will always use the default value related to the current color scheme. In the light mode it’s barely noticeable due to my pale grey background for the panel, but the dark mode is obvious:
brian
(Brian Gillespie)
November 13, 2024, 12:04am
6
1 Like