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

Add new tab button like Chrome browser

19 Answers 265 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Inseok
Top achievements
Rank 1
Inseok asked on 26 Mar 2011, 08:14 AM
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

19 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 28 Mar 2011, 02:01 PM
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
0
Sajjad Shah
Top achievements
Rank 1
answered on 06 Jun 2011, 03:22 PM
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..?
 
0
Sajjad Shah
Top achievements
Rank 1
answered on 06 Jun 2011, 03:22 PM
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..?
 
0
Inseok
Top achievements
Rank 1
answered on 06 Jun 2011, 03:27 PM
Currently(Q1 2011 SP1), It works fine. :)
0
Petar Mladenov
Telerik team
answered on 09 Jun 2011, 02:46 PM
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
0
Sajjad Shah
Top achievements
Rank 1
answered on 09 Jun 2011, 02:54 PM
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.
0
Petar Mladenov
Telerik team
answered on 14 Jun 2011, 04:54 PM
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
0
Sajjad Shah
Top achievements
Rank 1
answered on 14 Jun 2011, 05:03 PM
This zip file is not valid..?
0
Petar Mladenov
Telerik team
answered on 17 Jun 2011, 03:23 PM
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
0
Sajjad Shah
Top achievements
Rank 1
answered on 24 Jun 2011, 08:39 PM
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 ....
0
Petar Mladenov
Telerik team
answered on 29 Jun 2011, 03:24 PM
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
0
Sajjad Shah
Top achievements
Rank 1
answered on 29 Jun 2011, 04:19 PM
It is already there. Still does not work.
0
Petar Mladenov
Telerik team
answered on 04 Jul 2011, 09:27 AM
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
0
Joël
Top achievements
Rank 2
answered on 07 Nov 2011, 05:31 PM
It is possible to have this example in WPF, because I would wish to add a button “Add Tab" too.
0
Petar Mladenov
Telerik team
answered on 10 Nov 2011, 02:05 PM
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 >>

0
Dimitri Rakviashvili
Top achievements
Rank 1
answered on 12 Dec 2011, 02:31 PM
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 ...
0
Joël
Top achievements
Rank 2
answered on 12 Dec 2011, 02:46 PM
Actually, I changed my approach and I put my button before the tabs.
0
Chiara
Top achievements
Rank 1
answered on 26 Jan 2012, 04:18 PM
Hi Dimitri, 
have you solved the problem whit the add button?
0
Mark
Top achievements
Rank 1
answered on 07 Mar 2012, 03:35 PM
Just tried the WPF example. Beautiful. Thank you Petar.
Tags
TabControl
Asked by
Inseok
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Sajjad Shah
Top achievements
Rank 1
Inseok
Top achievements
Rank 1
Petar Mladenov
Telerik team
Joël
Top achievements
Rank 2
Dimitri Rakviashvili
Top achievements
Rank 1
Chiara
Top achievements
Rank 1
Mark
Top achievements
Rank 1
Share this question
or