RadTreeView items default expanded=true with container binding

5 posts, 0 answers
  1. Chris
    Chris avatar
    5 posts
    Member since:
    Jun 2010

    Posted 14 Mar 2011 Link to this post

    Hi,

    A little help with this problem would be great.

    I have a RadTreeView as follows

    <Controls:RadTreeView  
                Name="TreeView"
                IsVirtualizing="True"
                ItemTemplate="{StaticResource NodeTemplate}"
                ItemsSource="{Binding Tree}">
    </Controls:RadTreeView>


    with a hierarchical data template as follows

    <telerik:HierarchicalDataTemplate x:Key="NodeTemplate" ItemsSource="{Binding Children}" telerik:ContainerBinding.ContainerBindings="{StaticResource ContainerBindings}">
        <MyTemplateClass ItemText="{Binding Name}" />
    </telerik:HierarchicalDataTemplate>


    and I am also binding the IsExpanded property to the datacontext of MyTemplateClass using container bindings as follows

    <telerik:ContainerBindingCollection x:Key="ContainerBindings">
        <telerik:ContainerBinding PropertyName="IsExpanded" Binding="{Binding Expanded, Mode=TwoWay}" />
    </telerik:ContainerBindingCollection>


    I have an item X, which has a set 10 items inside it, and one of them, "Y", has many items inside it.  When I expand X, Y appears to expand and then unexpand, creating a very stuttered animation.  I have placed a converter on the container binding and have found that Y indeed is first set to true and then to false.  I have also debugged the property setter in the datacontext for MyTemplateClass and found that the binding source is never set to true, it remains false.

    I should also say that if I turn virtualising off then the problem goes away, the animation is smooth and Y is not expanded.

    I would like to keep Y false so that it does not expand when I expand X but cannot find where to make this setting.  Should I be looking to edit a template or should I try to change it in the converter or something else?

    Hope this makes sense.

    Thanks in advance,
    Chris
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 14 Mar 2011 Link to this post

    Hello Chris,

    Could you please send us a runnable sample demonstrating the issue? This will be highly appreciated since we are seriously interested in investigating this and we could advice you faster this way. You can also mention the exact version of the dlls that you use.Thank you in advance for your cooperation.

    All the best,
    Petar Mladenov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. DevCraft banner
  4. Chris
    Chris avatar
    5 posts
    Member since:
    Jun 2010

    Posted 14 Mar 2011 Link to this post

    Hi Petar,

    Thanks for your reply.  http://www.sendspace.com/file/kdntkq is a solution reproducing the problem.  If you expand node 5 you will hopefully see the problem.

    I have tried with both these assemblies..

    Telerik.Windows.Controls 2010.2.924.1040
    Telerik.Windows.Controls.Navigation 2010.2.924.1040

    ...and these assemblies...

    Telerik.Windows.Controls 2010.3.1110.1040
    Telerik.Windows.Controls.Navigation 2010.3.1110.1040

    ...but the problem occurs with both.

    I hope this enough to work with.

    Regards,
    Chris
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 17 Mar 2011 Link to this post

    Hi Chris,

    I managed to view this virtualization issue. The good news is that is resolved from the Q3 2010 SP1 (1314) and you can examine this in the attached solution. I've also noticed that your root collection is List which is bad practice. You better replace it with ObservableCollection. Feel free to ask if you need more info.

    Kind regards,
    Petar Mladenov
    the Telerik team
  6. Chris
    Chris avatar
    5 posts
    Member since:
    Jun 2010

    Posted 18 Mar 2011 Link to this post

    Hi Petar,

    Thanks for the solution.  It works perfectly with the new binaries - just downloaded 2011.1 :)

    Regards,

    Chris
Back to Top
DevCraft banner