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

Hide Tab Item Header

10 Answers 389 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Brian Lampe
Top achievements
Rank 1
Brian Lampe asked on 25 May 2010, 06:07 PM
We have a requirement to drive our tab control from elsewhere in the application, and so, the header tabs have become unnecessary. 

Is there a way we can hide the tabs in a RadTabControl?  Or, is there a better control for our needs? 

TIA

Brian 

10 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav
Telerik team
answered on 26 May 2010, 01:55 PM
Hello Brian Lampe,

To hide the headers you may need to modify the control's Template.

Generally if your content is available as a property and its loading will not be managed by the TabControl, you can use a ContentControl or ContentPresenter and bind its Content property to your the content supplier.

You can also use the TransitioningContentControl which will animate the content changes.

Indeed using the TabControl may be unnecessary just for content switching.

Kind regards,
Miroslav
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
Robert
Top achievements
Rank 1
answered on 15 Jun 2010, 09:26 PM
I don't see why the Telerik support analyst did not provide example code to accomplish this?  Just speaking in generalities is not particularly helpful.  I have a similar requirement, and it would have saved me time if I had found a concrete solution here.  Instead, I will have to ask the same question via support ticket.
0
Kiril Stanoev
Telerik team
answered on 16 Jun 2010, 01:07 PM
Hi Robert,

Thank you for your feedback. We are constantly trying to improve our support process and your opinion is of high importance for you. I've posted an answer to your support thread. Have a look at it and let me know if it helps.

Greetings,
Kiril Stanoev
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
Adrian Pay
Top achievements
Rank 1
answered on 24 Feb 2011, 09:46 AM
again, didnt post the answer. instead, decided to forward PRIVATELY the answer to the previous poster.

now, i have to BEG for the answer to the same question. can u just post the attachment here so everyone else who stumbles upon the same question will not need to ask AGAIN?

hope your support improves.
0
Hristo
Telerik team
answered on 28 Feb 2011, 01:38 PM
Hi Adrian Pay,

Basically there are two approaches you can take to achieve this functionality. First, you can go in Expression Blend, edit the ControlTemplate of RadTabControl and remove (or hide) the header strip. The other way is to collapse it using the VisualTreeHelper class like this:

public MainWindow()
{
    InitializeComponent();
  
    Dispatcher.BeginInvoke(new Action(() =>
    {
        var root = VisualTreeHelper.GetChild(this.WizardTabs, 0) as FrameworkElement;
        var headerElement = root.FindName("HeaderDockedElement") as UIElement;
        headerElement.Visibility = System.Windows.Visibility.Collapsed;
    }), System.Windows.Threading.DispatcherPriority.ApplicationIdle);
}

I'm sorry for the inconvenience and hope the answer will be of help to you. Let us know if you have further questions.


Regards,
Hristo
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
ravenger
Top achievements
Rank 1
answered on 31 Aug 2011, 08:54 AM
This code working on WPF, but it doesn't on Silverlight. Because silverlight doesn't have "DispatcherPriority.ApplicationIdle" property. 
Without dispatcher this code didn't working when application starting, but working after application was started.
Can you help me adapt this code to Silverlight?
0
Hristo
Telerik team
answered on 02 Sep 2011, 01:01 PM
Hello Ravenger,

You could remove the last parameter of the method and try with the Dispatcher class in SL. I tested this code and it works in my sample app:

Dispatcher.BeginInvoke(new Action(() =>
            {
                LayoutTransformControl a = Telerik.Windows.Controls.ChildrenOfTypeExtensions.ChildrenOfType<LayoutTransformControl>(this.thetab).FirstOrDefault();
                if (a != null)
                {
                    a.Visibility = System.Windows.Visibility.Collapsed;
                }
            }));

Hope this helps. Please, let us know if you need further assistance.Kind regards,
Hristo
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
ravenger
Top achievements
Rank 1
answered on 02 Sep 2011, 10:11 PM
Thank you
0
Mohamed
Top achievements
Rank 1
answered on 16 Dec 2011, 10:58 AM
Hey this works , thank you very much . may allah bless U
0
Gene
Top achievements
Rank 1
answered on 22 Jan 2012, 09:20 PM
Thanks, this worked like a charm and is easy to revert should the requirement change back to showing the tab headers.
Tags
TabControl
Asked by
Brian Lampe
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Robert
Top achievements
Rank 1
Kiril Stanoev
Telerik team
Adrian Pay
Top achievements
Rank 1
Hristo
Telerik team
ravenger
Top achievements
Rank 1
Mohamed
Top achievements
Rank 1
Gene
Top achievements
Rank 1
Share this question
or