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

RadTreeListView: AutoExpandItems is getting ignored

3 Answers 103 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
caleb
Top achievements
Rank 1
caleb asked on 03 Oct 2016, 09:40 AM

Hello there,

I've got version 2016.2.613.1050 of the Telerik Silverlight controls.  I've got a RadTreeListView

<telerik:RadTreeListView
    x:Name="GridView"
    DataLoadMode="Asynchronous"
    IsExpandableBinding="{Binding IsFolder}"
    AutoExpandItems="False"
    AutoExpandGroups="False"
    AutoLoadHierarchy="False"
    RowIsExpandedChanged="GridView_OnRowIsExpandedChanged"
    BorderThickness="0"
    VerticalAlignment="Top"
    ScrollViewer.VerticalScrollBarVisibility="Visible"
    ScrollViewer.HorizontalScrollBarVisibility="Disabled"
    Sorted="GridView_OnSorted"
    Width="{Binding Source={StaticResource VAR}, Path=ViewAreaWidthInside}"
    Height="{Binding Source={StaticResource VAR}, Path=ViewAreaHeightWithOffset}"
    CanUserFreezeColumns="False"
    IsReadOnly="False"
    RowIndicatorVisibility="Collapsed"
    Background="{Binding Source={StaticResource VAR-New},Path=VAR}"
    VirtualizingStackPanel.VirtualizationMode="Recycling"
    AutoGenerateColumns="False"
    engine:TreeViewDragDropBehavior.IsEnabled="True"
    IsDragDropEnabled="True"
    IsDragTooltipEnabled="False"
    CanUserDeleteRows="False"
    DragCueItemTemplate="{StaticResource FirstColumnCellTemplate}"
    Style="{StaticResource RadTreeListViewStyle1}"
    CellEditEnded="GridView_OnCellEditEnded"
    EnableColumnVirtualization="True"
    EnableRowVirtualization="True"
    MouseRightButtonDown="GridView_OnMouseRightButtonDown"
    Loaded="GridView_OnLoaded"
    Unloaded="GridView_OnUnLoaded"
>
<telerik:RadTreeListView.ChildTableDefinitions>
    <telerik:TreeListViewTableDefinition
    ItemsSource="{Binding Items}"
/>
</telerik:RadTreeListView.ChildTableDefinitions>
</telerik:RadTreeListView>

So I would assume that the expander rows would not auto expand.  However when I run this code that's exactly what happens.  The auto expanders appear to be ignoring the false property and expanding. 

How do I get this to work?  What I want to happen is each expander row to stay closed and expand as the user selects them.  I reviewed the .xaml.cs and there's no code there that is setting the expander property.

Cheers,

 

Caleb

3 Answers, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 05 Oct 2016, 10:54 AM
Hello,

I tried to reproduce the behavior you've described in a sample project, but was, unfortunately, unable to do so. Could you please have a look at the attached project and let me know if I've missed something of importance?

It would really be of help if you could also provide the code-behind where you've handled RadTreeListView's events.

Thank you in advance for your cooperation on the matter. I will be awaiting your reply.

Regards,
Dilyan Traykov
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
caleb
Top achievements
Rank 1
answered on 05 Oct 2016, 02:10 PM

Hello there,

 

I'm not able to get the supplied bit of code to compile.  VS 2012 can't seem to resolve the Telerik bits.  Anyways.  I'm not sure this is a good example.  The issue that I have is that I have a collection of data each piece of data is either a folder or a file.  The folders might have children, the files certainly don't.  I don't see how that is modeled in the .xaml that you sent me.  Can you modify your example to work with the above scenario?

Thanks,

Caleb

0
caleb
Top achievements
Rank 1
answered on 05 Oct 2016, 02:24 PM

Mate!

 

I had an attached behavior that was causing this problem.  The OnLoaded method was calling ExpandAllHierarchyItems();

 

Thanks,

 

Caleb

Tags
TreeListView
Asked by
caleb
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
caleb
Top achievements
Rank 1
Share this question
or