Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > TabControl > Hide Tab Item Header

Answered Hide Tab Item Header

Feed from this thread
  • Posted on May 25, 2010 (permalink)

    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 

    Reply

  • Answer Miroslav Miroslav admin's avatar

    Posted on May 26, 2010 (permalink)

    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.

    Reply

  • Robert avatar

    Posted on Jun 15, 2010 (permalink)

    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.

    Reply

  • Kiril Stanoev Kiril Stanoev avatar

    Posted on Jun 16, 2010 (permalink)

    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.

    Reply

  • Adrian Pay avatar

    Posted on Feb 24, 2011 (permalink)

    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.

    Reply

  • Hristo Hristo admin's avatar

    Posted on Feb 28, 2011 (permalink)

    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!

    Reply

  • ravenger avatar

    Posted on Aug 31, 2011 (permalink)

    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?

    Reply

  • Hristo Hristo admin's avatar

    Posted on Sep 2, 2011 (permalink)

    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 >>

    Reply

  • ravenger avatar

    Posted on Sep 2, 2011 (permalink)

    Thank you

    Reply

  • Mohamed avatar

    Posted on Dec 16, 2011 (permalink)

    Hey this works , thank you very much . may allah bless U

    Reply

  • Gene avatar

    Posted on Jan 22, 2012 (permalink)

    Thanks, this worked like a charm and is easy to revert should the requirement change back to showing the tab headers.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > TabControl > Hide Tab Item Header
Related resources for "Hide Tab Item Header"

WPF TabControl Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]