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

TabItem hightlight issue

2 Answers 53 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Minwei
Top achievements
Rank 1
Minwei asked on 15 Feb 2011, 08:29 AM
A childwindow will popup for one second everytime when I change TabItem in my program. The issue is that two or more TabItems will hightlight and sometimes no TabItem will highlight.I add two screenshots in attachments.And I attach the .xaml and .xaml.cs files.

Waiting for your solution, Thanks.

The MainPage.xmal:
<UserControl x:Class="TabControlHightlight.MainPage"
 
    <Grid x:Name="LayoutRoot" Background="White">
 
        <telerik:RadTabControl x:Name="tcDemo" SelectionChanged="tcDemo_SelectionChanged"
                               Width="800" Height="500" ScrollMode="Item">
 
            <telerik:RadTabItem Header="first" Width="80" Height="30"/>
            <telerik:RadTabItem Header="second" Width="80" Height="30"/>
            <telerik:RadTabItem Header="third" Width="80" Height="30"/>
            <telerik:RadTabItem Header="fouth" Width="80" Height="30"/>
            <telerik:RadTabItem Header="fifth" Width="80" Height="30"/>
            <telerik:RadTabItem Header="sixth" Width="80" Height="30"/>
            <telerik:RadTabItem Header="seventh" Width="80" Height="30"/>
            <telerik:RadTabItem Header="eight" Width="80" Height="30"/>
            <telerik:RadTabItem Header="ninth" Width="80" Height="30"/>
            <telerik:RadTabItem Header="tenth" Width="80" Height="30"/>
        </telerik:RadTabControl>
    </Grid>
</UserControl>

The MainPage.xaml.cs:
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
 
namespace TabControlHightlight
{
    public partial class MainPage : UserControl
    {
        ChildWindow cw;
 
        public MainPage()
        {
            InitializeComponent();
            cw = new ChildWindow() { Width = 200, Height = 100 };
        }
 
        private void tcDemo_SelectionChanged(object sender, RoutedEventArgs e)
        {
            cw.Show();
 
            DispatcherTimer timer = new DispatcherTimer();
            timer.Tick += new EventHandler(timer_Tick);
            timer.Interval = new TimeSpan(0, 0, 1);
            timer.Start();
        }
 
        void timer_Tick(object sender, EventArgs e)
        {
            cw.Close();
                   timer.Stop();
        }
    }
}

2 Answers, 1 is accepted

Sort by
0
Accepted
Alex Fidanov
Telerik team
answered on 17 Feb 2011, 04:15 PM
Hi Minwei,

This issue is because the child window prevents the RadTabItem from leaving its MouseOver state. When the ChildWindow shows up, it covers the RadTabItem and stops its MouseLeave event from raising, therefore the TabItem stays as hovered. I have logged this in our PITS under "TabControl can have multiple TabItems in MouseOver state when another control is shown ontop in SelectionChanged event" and you can check its progress. It will be visible as early as tomorrow.

Kind regards,
Alex Fidanov
the Telerik team
0
Minwei
Top achievements
Rank 1
answered on 18 Feb 2011, 02:35 AM
OK, thank you.
I will check it. until this issue is resolved, and this problem effects the GUI in our project.
Tags
TabControl
Asked by
Minwei
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Minwei
Top achievements
Rank 1
Share this question
or