Add new tab button like Chrome browser

20 posts, 1 answers
  1. Inseok
    Inseok avatar
    12 posts
    Member since:
    Mar 2011

    Posted 26 Mar 2011 Link to this post

    Hi, I'm trying to make a TabControl to contain "new tab button".
    You guys might know what I want to.

    Actually, there 'was' a simple solution:
    1. Edit TabControl's template.
    2. Modify inside of ScrollView "ScrollViewerElement" like:
    <ScrollViewer x:Name="ScrollViewerElement" ><!-- other attributes are omitted -->
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
            <ItemsPresenter/>
            <Button Content="+New" Click="Button_Click"/>
        </StackPanel>
    </ScrollViewer>

    It worked with Q3 2010 version of RatTabControl.
    But same code doesn't work with Q1 2011 version.

    The issue what I'm facing at, is the button( in the StackPanel inside the ScrollViewer) doesn't raise Click event at all.
    It's strange because the button still interact with MouseEnter and MouseLeft events so I can see the VisualTransition between the MouseOver State and the Normal State.
    It seems that the RadDockPanel(or something other) hooks any MouseLeftButtonDown and Handle it.
    Could you make sure why this happens?
    Here's a test project: http://cid-60778ca3c47c21fe.office.live.com/self.aspx/Public/AddNewTabTest.zip

    Oh, and I saw another solution which controls Items and ItemsSource of TabControl so that I can make sure the TabControl always contains the 'new tab button TAB'.
    It's possible, but I think it's too messy and it could be a cause of side-effect.

    Regards,
    Gongdo
  2. Answer
    Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 28 Mar 2011 Link to this post

    Hi Inseok,

    We made a major refactoring of the RadTabCotnrol. Unfortunately we introduce some new issues and bugs. However we are currently working on these issues and closing them one by one.

    The described scenario represents a bug in the tab control and we will fix it for our next internal build (in the beginning of the next week). I've updated your Telerik point +1000.

    Hope this helps. Let me know if you have further questions.

    Best wishes,
    Hristo
    the Telerik team
  3. DevCraft banner
  4. Sajjad Shah
    Sajjad Shah avatar
    33 posts
    Member since:
    Nov 2009

    Posted 06 Jun 2011 Link to this post

    Is this New tab (+) type style (like Google Chrome) availbale now in the latest release and working..? If not, Was this feaure availabe in previos release at all..?
     
  5. Sajjad Shah
    Sajjad Shah avatar
    33 posts
    Member since:
    Nov 2009

    Posted 06 Jun 2011 Link to this post

    Is this New tab (+) type style (like Google Chrome) availbale now in the latest release and working..? If not, Was this feature availabe in previous release at all..?
     
  6. Inseok
    Inseok avatar
    12 posts
    Member since:
    Mar 2011

    Posted 06 Jun 2011 Link to this post

    Currently(Q1 2011 SP1), It works fine. :)
  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 09 Jun 2011 Link to this post

    Hello Inseok,

    @Sajjad Shah
    You can examine this demo and let us know if this is what you expect as a behavior. Feel free to ask if you need more info.

    Best wishes,
    Petar Mladenov
    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. Sajjad Shah
    Sajjad Shah avatar
    33 posts
    Member since:
    Nov 2009

    Posted 09 Jun 2011 Link to this post

    I have seen this one before. We want a dedicated tab item with a '+' symbol on it. Like chrome browser or IE.
    More preceisely: There is always a tab item appears at the end half visible and once you click on it, it turns into a complete tab item.

    Thanks.
  9. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 14 Jun 2011 Link to this post

    Hello Sajjad Shah,

    We prepared a sample project for you that shows RadTabControl behaving like a web browser. Please check it out and let us know if it is a good starting point for you.

    Best wishes,
    Petar Mladenov
    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
  10. Sajjad Shah
    Sajjad Shah avatar
    33 posts
    Member since:
    Nov 2009

    Posted 14 Jun 2011 Link to this post

    This zip file is not valid..?
  11. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 17 Jun 2011 Link to this post

    Hello Sajjad Shah,

    We tried the zip file that we sent you and everything ran as expected. Running the 367268_TabControlSample.sln file works and the solution builds and runs fine. Could you elaborate more on the problems you have faced with the zip ?

    Greetings,
    Petar Mladenov
    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
  12. Sajjad Shah
    Sajjad Shah avatar
    33 posts
    Member since:
    Nov 2009

    Posted 24 Jun 2011 Link to this post

    In the refence all the assemblies appear correctly but when I build I get this error message: The type or namespace name ViewModelBase could not be found ....
  13. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 29 Jun 2011 Link to this post

    Hi Sajjad Shah,

    Could you please try to add the following line and let us know if it helped you?
    using Telerik.Windows.Controls;
    using System.Collections.ObjectModel;
    using System.Collections.Specialized;
     
    namespace _367268_TabControlSample
    {
        public class MainViewModel : ViewModelBase


    Kind regards,
    Petar Mladenov
    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
  14. Sajjad Shah
    Sajjad Shah avatar
    33 posts
    Member since:
    Nov 2009

    Posted 29 Jun 2011 Link to this post

    It is already there. Still does not work.
  15. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 04 Jul 2011 Link to this post

    Hello Sajjad Shah,


    I guess you are using an older version of the telerik dlls, I included the Q1 2011 SP1 dlls 0419. Please let us know if everything runs fine at your side now. Thank you in advance.

    Greetings,
    Petar Mladenov
    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
  16. Joël
    Joël avatar
    32 posts
    Member since:
    Sep 2011

    Posted 07 Nov 2011 Link to this post

    It is possible to have this example in WPF, because I would wish to add a button Add Tab" too.
  17. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 10 Nov 2011 Link to this post

    Hello Laurent,

     Please find a basic converted version of this approach for WPF in the attached project.

    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  18. Dimitri Rakviashvili
    Dimitri Rakviashvili avatar
    4 posts
    Member since:
    Apr 2010

    Posted 12 Dec 2011 Link to this post

    Hello Laurent, your aproach works fine, except 1 thing :

    when scrolling buttons in tab control are shown (try to add 10 tabs), "plus" button hides, so it is not possible to add new tab ....

    Using Q2 2011 ...
  19. Joël
    Joël avatar
    32 posts
    Member since:
    Sep 2011

    Posted 12 Dec 2011 Link to this post

    Actually, I changed my approach and I put my button before the tabs.
  20. Chiara
    Chiara avatar
    31 posts
    Member since:
    Oct 2011

    Posted 26 Jan 2012 Link to this post

    Hi Dimitri, 
    have you solved the problem whit the add button?
  21. Mark
    Mark avatar
    3 posts
    Member since:
    Mar 2011

    Posted 07 Mar 2012 Link to this post

    Just tried the WPF example. Beautiful. Thank you Petar.
Back to Top
DevCraft banner