RadDocumentPane+RadExpander behaviour

5 posts, 0 answers
  1. Ivo
    Ivo avatar
    20 posts
    Member since:
    Mar 2009

    Posted 02 Sep 2009 Link to this post

    Hi,

    I'm having a strange behaviour when using an RadExpander inside a RadDocumentPane. I have two documentPanes (Tabs) in a SilverLight page in one of them I have one radExpander in close state, when I toggle several times between the  documentPanes(Tabs) the radexpander gets open for some strange reason.I have checked and this is happening in several of controls that I have created using also the radExpander. Do you have any idea why radExpander is loosing state and gets open when I'm toggling between tabs?
    I'm not completely sure when this started happen, but I'm pretty sure that in some long time ago version of the RadExpander control, this problem didn't happen.

    Thanks for your time,
    Ivo
  2. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 02 Sep 2009 Link to this post

    Hello Ivo,

    Are the RadDocumentPanes bound? If the RadExpander is part of a data template, then it could possibly change its state when the DataTemplate is recreated.

    Also, the RadExpander handles the space and enter keys and changes state when they are pressed.

    Are you using the RadExpander as part of data templates?

    Greetings,
    Miroslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Ivo
    Ivo avatar
    20 posts
    Member since:
    Mar 2009

    Posted 02 Sep 2009 Link to this post

    Hi Miroslav,

    I'm afraid the problem that I'm having is little more serious than this.
    What happens is what you can see in the picture:
    http://img136.imageshack.us/img136/4893/issue.png

    In this case i have a radtreeview, in the node the header is compose of a grid with an expander in the third column.
    Notice the arrows in the expander, it appears to be that by some strange reason the the invisible part of the expander appears out of nowhere.
    The realy strange thing about things is that sometimes this happens and sometimes not, sometimes I can spend lot of times toggling an it behaves normally and other times the first time I toggle between tabs this happens.
    This happens on any expander that I have, not just the complex one within this control.
    Do you have any idea, what it can be happening here?

    Thanks,
     Ivo 


  5. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 04 Sep 2009 Link to this post

    Hello Ivo,

    I browsed through the Expander's code and the only reason that I can think of is that the animation of the RadExpander starts asynchronously and could potentially be the reason for this when expanders are shown/hidden quickly.

    To be honest I could not reproduce this, but  the screenshots clearly show that the problem is present. Quite possibly I am missing something.

    What i can suggest is to disable the animations for the expander if there are any to check if this will help.

    I am attaching here one of the projects that I used to test this, but I am afraid it is overly simple and it does not show this behavior.

    Does this help in your case?

    Kind regards,
    Miroslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Ivo
    Ivo avatar
    20 posts
    Member since:
    Mar 2009

    Posted 04 Sep 2009 Link to this post

    Hi Miroslav,
    As usual you were a great help :)
    I was not defining animations, so I assume that RadComboBox  is using some default ones.
    I oppened in Expression Blend and found the default ones

        <vsm:VisualStateManager.VisualStateGroups> 
                        <vsm:VisualStateGroup x:Name="CommonStateGroup"
                            <vsm:VisualState x:Name="Normal"/> 
                            <vsm:VisualState x:Name="Disabled"
                                <Storyboard> 
                                    <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="HeaderButton" Storyboard.TargetProperty="Opacity" To="0.5"/> 
                                </Storyboard> 
                            </vsm:VisualState> 
                        </vsm:VisualStateGroup> 
                        <vsm:VisualStateGroup x:Name="ExpandStateGroup"
                            <vsm:VisualState x:Name="Expanded"
                                <Storyboard> 
                                    <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Opacity" To="1"/> 
                                </Storyboard> 
                            </vsm:VisualState> 
                            <vsm:VisualState x:Name="Collapsed"
                                <Storyboard> 
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Visibility"
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0.1"
                                            <DiscreteObjectKeyFrame.Value> 
                                                <Visibility>Collapsed</Visibility> 
                                            </DiscreteObjectKeyFrame.Value> 
                                        </DiscreteObjectKeyFrame> 
                                    </ObjectAnimationUsingKeyFrames> 
                                    <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Opacity" To="0.5"/> 
                                </Storyboard> 
                            </vsm:VisualState> 
                        </vsm:VisualStateGroup> 
                    </vsm:VisualStateManager.VisualStateGroups> 
    What I did next was to apply this in my ExpanderRightTemplate this  VisualStateGroup and proceed to comment the storyboards and test my application.
    When I commented the Collapsed visual state, the problem didn't happen any more.
    To be honest I don't have a lot Know-how regarding visual states, so I don't have any idea why this works when I comment the collapsed story board, but I hope this helps you to possibly identify some problem and make the RadExpander even more stable.

    Thanks once again for the big help,
    Ivo

Back to Top
DevCraft banner