Setting HeaderBackground

8 posts, 0 answers
  1. Simon
    Simon avatar
    47 posts
    Member since:
    May 2008

    Posted 07 Jun 2010 Link to this post

    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
  2. Dimitrina
    Admin
    Dimitrina avatar
    442 posts

    Posted 09 Jun 2010 Link to this post

    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.
  3. DevCraft banner
  4. Dan Kinchen
    Dan Kinchen avatar
    27 posts
    Member since:
    Mar 2010

    Posted 10 Jun 2010 Link to this post

    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.
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 15 Jun 2010 Link to this post

    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.
  6. Simon
    Simon avatar
    47 posts
    Member since:
    May 2008

    Posted 15 Jun 2010 Link to this post

    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
  7. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 18 Jun 2010 Link to this post

    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
  8. Simon
    Simon avatar
    47 posts
    Member since:
    May 2008

    Posted 20 Jun 2010 Link to this post

    Hi,

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

    Thanks
  9. Dimitrina
    Admin
    Dimitrina avatar
    442 posts

    Posted 22 Jun 2010 Link to this post

    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
Back to Top
DevCraft banner