Nevron Forum

What is the Best way to change Header text Color for NGrouper control

https://www.nevron.com/Forum/Topic9404.aspx

By Raul Valle - Monday, October 12, 2015

Hi there,

I new to Nevron. What is the best way to change the Header item text color?

I tried
ctrl.PaletteInheritance = Nevron.UI.WinForm.Controls.PaletteInheritance.None;
ctrl.Palette.ControlText = Color.White;

and works, but it also changes the text color for some other controls like the check boxes.


By Nevron Support - Tuesday, October 13, 2015

Hi Raul,

You have two options:

After you apply the new ControText on the NGrouper you can set PaletteInheritance to all controls that are contained in the grouper to None, and set their Palette property to NUIManager.Palette:

int count = ctrl.Controls.Count;
for (int i = 0; i < count; i++)

    INPaletteProvider paletteProviderControl = ctrl.Controls[i] as INPaletteProvider;
    if (paletteProviderControl != null)
    {
        paletteProviderControl.PaletteInheritance = PaletteInheritance.None;
        paletteProviderControl.Palette = NUIManager.Palette;
    }
}


The other option is to set the TextFillStyle property of the NGrouper.HeaderItem:

ctrl.HeaderItem.Style.TextFillStyle = new NColorFillStyle(Color.White);

By Raul Valle - Tuesday, October 13, 2015

Thanks,

The first option worked, the second did not.