Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
Setting backcolor of grouped column header.
posted

Hi

I'm having a bit of a problem setting the back color of a column header when it has been dragged into the Group Area.


We use a Label Presenter based on a Office Theme and set our own BackColor & HighlightColor which works fine, the problem is when the column is grouped, it seems to override the color settings when displaying in the group header section.

From the screenshot you can see that the grouped column header backcolor is still a yellow color. How can we change this?

The code we use to setup the LabelPresenter is as follows...

 var labelPresenterStyle = new Style(typeof(LabelPresenter));
labelPresenterStyle.BasedOn =
DataPresenterOffice2k7Blue.LabelPresenter;

 

//Create a new setter, setting the LabelHighlightProperty to our default DefaultLabelHighlightBrush.
var bkColorSetter = new Setter(LabelPresenter.LabelHighlightProperty, new LinearGradientBrush(Colors.DodgerBlue, Colors.DodgerBlue, 0));
labelPresenterStyle.Setters.Add(bkColorSetter);

 

//Create a new setter to set the Label Background Color.
var bkSetter = new Setter(LabelPresenter.BackgroundProperty, new LinearGradientBrush(Colors.DodgerBlue, Colors.DodgerBlue, 0));
labelPresenterStyle.Setters.Add(bkSetter);

 

//Create a new setter to set the label Foreground Color.
var fgSetter = new Setter(LabelPresenter.ForegroundProperty, new LinearGradientBrush(Colors.White, Colors.White, 0));
labelPresenterStyle.Setters.Add(fgSetter);

 

//Add it back into the main grid resources.
grid.Resources.Add(typeof(LabelPresenter), labelPresenterStyle);

 

 

 

 

Thanks

Parents Reply Children