-
My Sketch from Illustrator of what I want to draw. I am trying to change the color and font of the Header. What about the Hover Color? I don't see the relevant event to change it. is it possible? Really grateful for all your support over all these time @cwensley ! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
After some researching, I am able to change the Header's fontsize with the following code.
|
Beta Was this translation helpful? Give feedback.
-
However, I could yet to figure how to change the hover cell color or the color upon selecting the row. |
Beta Was this translation helpful? Give feedback.
-
@cwensley Hi Curtis. I am still unable to change the highlight color in wpf. I have figured out how to change the hover color though: System.Windows.Trigger hoverTrigger = new System.Windows.Trigger { Property=System.Windows.Controls.Control.IsMouseOverProperty, Value=true};
hoverTrigger.Setters.Add(new System.Windows.Setter(
System.Windows.Controls.Control.BackgroundProperty, new swm.SolidColorBrush(swm.Color.FromRgb(240, 240, 240))));
hoverCellStyle.Triggers.Add(hoverTrigger);
gch.Control.RowStyle = hoverCellStyle;` I tried the following, but it doesn't work. System.Windows.DataTrigger selectTrigger = new System.Windows.DataTrigger();
selectTrigger.Binding = new System.Windows.Data.Binding("DataGridRow.isSelected");
selectTrigger.Value = true;
selectTrigger.Setters.Add(new System.Windows.Setter(
System.Windows.Controls.Control.BackgroundProperty, new swm.SolidColorBrush(swm.Color.FromRgb(240, 240, 240))
)); |
Beta Was this translation helpful? Give feedback.
-
I finally got it!! Recording.49.mp4 |
Beta Was this translation helpful? Give feedback.
I finally got it!!
Turns out the codes I have was correct, it just got overwritten by OnCellFormatting!
Recording.49.mp4