This is a migrated thread and some comments may be shown as answers.

Custom formatting after LoadLayout

2 Answers 75 Views
LayoutControl
This is a migrated thread and some comments may be shown as answers.
Tomáš
Top achievements
Rank 1
Iron
Tomáš asked on 29 Oct 2020, 05:29 PM

Hello,

I have a hard time trying to customize a group header. I use something like this:

this.layoutControlGroupItem1.HeaderElement.BackColor = ColorTranslator.FromHtml("#008de7");

this.layoutControlGroupItem1.HeaderElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;

this.layoutControlGroupItem1.HeaderElement.HeaderButtonElement.DrawFill = false;

It works fine. But if I want to load a custom layout using RadLayoutCountrol's LoadLayout first, then this code does nothing...

I must be missing something elementary...

Thanks in advance for help

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Nadya | Tech Support Engineer
Telerik team
answered on 30 Oct 2020, 03:19 PM

Hello, Tomáš,

If I understand you correctly, you would like to change the HeaderElement.BackColor property after you load the layout. Note, that when loading the layout the LayoutControlGroupItem is recreated and you should access it as follows:

this.radLayoutControl1.LoadLayout(s);

LayoutControlGroupItem gi = this.radLayoutControl1.Items[0] as LayoutControlGroupItem;
gi.HeaderElement.BackColor = ColorTranslator.FromHtml("#008de7");
gi.HeaderElement.DrawFill = true;
gi.HeaderElement.GradientStyle = GradientStyles.Solid;

I hope this helps. Should you have other questions please let me know.

Regards,
Nadya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Tomáš
Top achievements
Rank 1
Iron
answered on 30 Oct 2020, 05:52 PM

Hello, Nadya,

yes, that's exactly what I needed.

Thanks a lot!

Have a nice weekend

Tomáš

Tags
LayoutControl
Asked by
Tomáš
Top achievements
Rank 1
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Tomáš
Top achievements
Rank 1
Iron
Share this question
or