This is a migrated thread and some comments may be shown as answers.
Setting HeaderBackground
7 Answers 49 Views
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 08 Jun 2010, 04:19 AM
Hi,

Is there a way to set the  HeaderBackground for a TabControl WITHOUT having to go through the process of creating a new style for the tab? Seems like a lot of work for something that should be a property - most people would want to change this to match the application background. 

if I can't, can I request this as a new feature?

Thanks

7 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 09 Jun 2010, 02:08 PM
Hello Simon,

Please find attached an example.

If you have further questions please do not hesitate to ask us.
I hope this will help you.


All the best,
Dimitrina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Dan Kinchen
Top achievements
Rank 1
answered on 10 Jun 2010, 02:38 PM
Any way to get this posted in a project that will open in VS2008?  I assume this is a VS2010 project because it doesn't open in VS2008.  Also, I looked at the code and I don't see anything that is going to change the background of an individual tab item header.  All you've done is wrap a tab control in a border with a red background and set the Backgroundvisibility for the entire tab control to Collapsed.  I need to be able to toggle the background of an individual header's background at runtime.  I have a tabbed data entry form with validation and I need to be able to toggle the tab item headers to red if a field on that tab item is in error so the user can see which tab has an error if they are coming in for the first time and the data is loaded from the database.
0
Tina Stancheva
Telerik team
answered on 15 Jun 2010, 04:43 PM
Hi Dan Kinchen,

Please accept our apology for the misunderstanding.

You are right that there isn't a single property like HeaderBackground that can be used to implement the described scenario. Therefore I wanted to ask you to elaborate on what do you expect such a property to do and also if you expect the RadTabControl and/or the RadTabItems to have such a property.

However, for now, except Style, you can implement this scenario using a HeaderTemplate and defining a border around each tab header. If you define two HeaderTemplates  for the RadTabItems and set a border in them with a proper background, you can set a different HeaderTemplate for each TabItem depending on your custom logic.

I prepared a sample project illustrating this approach. Give it a try and let us know if it works for you.

Best wishes,
Tina Stancheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Simon
Top achievements
Rank 1
answered on 16 Jun 2010, 12:45 AM
Thanks for your example however unfortunately I was not clear enough in my question.

What I really meant to ask was...

Is there a way to set the background colour for a tab (as in the tab colour (not the background of the tab as per your example)) without templating..
I have done it in code now using a extended VisualTreeHelper that iterates though the children to find HeaderBackground border from the template and then sets its background to the colour I want. 
However this is a lot of work and I would have thought a property would be much easier. 
Like TabColor for example.

Thanks Simon
0
Valentin.Stoychev
Telerik team
answered on 18 Jun 2010, 12:17 PM
Hi Simon,

Can you send us a snapshot of the desired result. We can't figure quite well what should this property do.

Regards,
Valentin.Stoychev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Simon
Top achievements
Rank 1
answered on 21 Jun 2010, 01:41 AM
Hi,

I've attached a screen shot. Simply the selected tab is given a color - which is different from the standard grey color.

Thanks
0
Dimitrina
Telerik team
answered on 22 Jun 2010, 09:26 AM
Hello Simon,

Thanks for the provided screenshot. Unfortunately, there is no property for changing the backgound of the RadTabItems. We might consider this for future releases, especially if this appears to be a common client request. For the time being the only way to change/customize the tabitem's background is using Blend.

Sincerely yours,
Dimitrina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Asked by
Simon
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Dan Kinchen
Top achievements
Rank 1
Tina Stancheva
Telerik team
Simon
Top achievements
Rank 1
Valentin.Stoychev
Telerik team
Share this question
or