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

RadTabItem SelectedItem Stying Issue

1 Answer 72 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Rakesh
Top achievements
Rank 1
Rakesh asked on 19 Apr 2012, 12:45 AM
I modified the ControlTemplate of RadTabItem to look like the image I provided.



In RadTabItem Template we have 3 Borders(Normal, MouseOver, Selected), So I replaced with Paths to look like this.
But I have to problems.
1) The Unselected Item should be behind the previous item (i.e tab2 should be behind tab1).
2) When we select an Item it should appear front. here tab4 is over tab3.

I looked for all the solutions, I don't find any.
Is there anyway we can  do this.

Looking forward for someone to help..

Thanks
Rakesh

1 Answer, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 21 Apr 2012, 04:40 PM
Hello Rakesh,

 You can check the following approaches, especially the workaround from Tina:
TabHeaderShapeRequest
which uses SelectionChangedEvent and the ZIndex attached property:

void tabControl_PreviewSelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
{
    if (e.AddedItems.Count != 0)
    {
        RadTabItem newSelectedItem = e.AddedItems[0] as RadTabItem;
        newSelectedItem.SetValue(Canvas.ZIndexProperty, 2);
    }
    if (e.RemovedItems.Count != 0)
    {
        RadTabItem oldSelectedItem = e.RemovedItems[0] as RadTabItem;
        oldSelectedItem.SetValue(Canvas.ZIndexProperty, 0);
    }
}
You may also find this project useful:
Enclosed tab Style
Regards,
Petar Mladenov
the Telerik team

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

Tags
TabControl
Asked by
Rakesh
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or