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


https://www.nevron.com/Forum/Topic9404.aspx
Print Topic | Close Window

By Raul Valle - 9 Years Ago
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 - 9 Years Ago
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 - 9 Years Ago
Thanks,

The first option worked, the second did not.