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

Close button on tabs doesn't work reliably

4 Answers 125 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 28 Nov 2012, 10:00 PM
Our project uses Prism with great success. One of our Prism regions is a RadTabControl and we programmatically add and remove tabs via Prism. Each of our tabs needs to have a close button so we've defined a ClosableTabItemHeader that looks like this:

<UserControl x:Class="Infrastructure.Controls.ClosableTabItemHeader"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300">
    <StackPanel Orientation="Horizontal">
        <TextBlock Text="{Binding Screen.DisplayName}"
                   FontWeight="DemiBold" />
        <telerik:RadButton Width="14"
                           Height="14"
                           Margin="5,0,0,0"
                           HorizontalAlignment="Center"
                           VerticalAlignment="Center"
                           Command="{Binding Screen.CloseCommand}"
                           Padding="0">
            <Image Source="pack://application:,,,/Resources;component/Glyphs/24/cross.png"
                   Height="10"
                   Width="10" />
        </telerik:RadButton>
    </StackPanel>
</UserControl>

Our RadTabItems use our ClosableTabItemHeader as such...

<telerik:RadTabItem.Header>
    <Controls:ClosableTabItemHeader DataContext="{Binding}" />
</telerik:RadTabItem.Header>

For months this worked without any problems at all. Lately, however, we're noticing that we sometimes have to click the close button two or more times for the command to execute. We've gone over our code with a fine tooth comb and from what we can tell the bound command simply isn't being called. We're out of ideas so we're hoping that Telerik might have one or two.

Greg

4 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 03 Dec 2012, 02:38 PM
Hello Greg,

I'm not sure what exactly is causing the issue in your case - can you try to isolate the issue in a sample solution so that we can test it locally? That would greatly help us in quickly narrowing down the cause for the issue and we'll be able to suggest a solution.

Thank you in advance.

Regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
ClausDC
Top achievements
Rank 1
Iron
answered on 05 Aug 2013, 02:36 PM
We have this problem, too. It's difficult to reproduce because it's quite random.

But when it occurs it usually stays for the lifetime (but not always, maybe a hint to some kind of garbage collection problem?) of the application for every tab. In my case, when the problem occurs, I always have to click the close button exactly twice.

I noticed that in this case, the first click starts the "pressed" animation of the button but immediately returns to the "unpressed" state of the button (and the command to close the tab isn't executed) as long as I keep the mouse button pressed which is different from the normal behaviour.
0
ClausDC
Top achievements
Rank 1
Iron
answered on 05 Aug 2013, 02:55 PM
I just noticed this thread: http://www.telerik.com/community/forums/wpf/tabcontrol/button-click-event-suppressed-by-radtabcontrol.aspx

These issues seem related.

It even is in your bug tracking system:

http://www.telerik.com/support/pits.aspx#/public/silverlight/9428

I checked one tab where I got this problem pretty reliably and it has indeed a button on it with "IsDefault=true", I removed this and lo and behold, the problem disappears.

I hope this helps with fixing the issue.
0
Pavel R. Pavlov
Telerik team
answered on 08 Aug 2013, 01:28 PM
Hello Claus,

You are right the PITS issue is similar to the reported behavior. As it is already logged in our PITS you can follow it and vote for it. Please stay tuned for any changes to that item.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
TabControl
Asked by
Greg
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
ClausDC
Top achievements
Rank 1
Iron
Pavel R. Pavlov
Telerik team
Share this question
or