Close button on tabs doesn't work reliably

5 posts, 0 answers
  1. Greg
    Greg avatar
    22 posts
    Member since:
    Aug 2011

    Posted 28 Nov 2012 Link to this post

    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"
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="{Binding Screen.DisplayName}"
                       FontWeight="DemiBold" />
            <telerik:RadButton Width="14"
                               Command="{Binding Screen.CloseCommand}"
                <Image Source="pack://application:,,,/Resources;component/Glyphs/24/cross.png"
                       Width="10" />

    Our RadTabItems use our ClosableTabItemHeader as such...

        <Controls:ClosableTabItemHeader DataContext="{Binding}" />

    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.

  2. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 03 Dec 2012 Link to this post

    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.

    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. ClausDC
    ClausDC avatar
    65 posts
    Member since:
    Feb 2010

    Posted 05 Aug 2013 Link to this post

    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.
  4. ClausDC
    ClausDC avatar
    65 posts
    Member since:
    Feb 2010

    Posted 05 Aug 2013 Link to this post

    I just noticed this thread:

    These issues seem related.

    It even is in your bug tracking system:

    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.
  5. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1251 posts

    Posted 08 Aug 2013 Link to this post

    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.

    Pavel R. Pavlov
    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 >>
Back to Top