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

RadTreeListView, IsSynchronizedWithCurrentItem property not working.

1 Answer 184 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Dursun
Top achievements
Rank 1
Dursun asked on 07 Mar 2014, 08:17 AM
Hi,

Previously I was using RadGridView with RadDataForm.
When IsSynchronizedWithCurrentItem property setted to True value, this controls working synchronous.

I needed Hierarchical items on some modules and I solved this problem with RadGridView.
But hierarchical data very complex for last user on RadGridView, that's not user-friendly.

I decided on the RadTreeListView after that, and I solved this with hierarchical TreeListView.
But there's a problem, IsSynchronizedWithCurrentItem setted True but RadTreeListView with RadDataForm not working synchronous.

How can solve this problem?

<telerik:RadTreeListView x:Name="mRadTreeListView"
                     IsReadOnly="True"
                     AutoExpandItems="True"
                     AutoGenerateColumns="False"
                     CanUserFreezeColumns="False"
                     ItemsSource="{Binding Items}"
                     IsSynchronizedWithCurrentItem="True"
                     RowIndicatorVisibility="Collapsed"
                     RowDetailsVisibilityMode="Collapsed">
    <telerik:RadTreeListView.ChildTableDefinitions>
        <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
    </telerik:RadTreeListView.ChildTableDefinitions>
</telerik:RadTreeListView>
<telerik:RadDataForm x:Name="mRadDataForm"
                     ItemsSource="{Binding Items}"
                     VerticalAlignment="Top"
                     LabelPosition="Above"
                     AutoGenerateFields="False"
                     CommandButtonsVisibility="All"
                     AutoCommit="True">
</telerik:RadDataForm>

1 Answer, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 10 Mar 2014, 03:30 PM
Hello Dursun,

This is the expected behavior when using RadTreeListView as you depend on the CurrentItem changing of the source collection.
Let me explain the case in details. RadTreeListView internally uses HierarchicalCollectionView that contains all items and does not notify the source collection about the current item change. RadTreeListView CurrentItem can be from either parent or child source, in your case - item from Items collection or item from Children collection. The problem comes when those collections have to be notified about TreeListView CurrentItem change. When it is an item from Children collection, what happens with the current item of the parent collection? This is why this logic is not implemented.
What you can do is to:
1. Listen for RadTreeListView.Items collectiion CurrentChanged event and change RadDataForm CurrentItem accordingly.
2. Bind RadGridView CurrentItem/SelectedItem to RadDataForm CurrentItem with TwoWay mode.

I hope this helps.

Regards,
Vera
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

Tags
TreeListView
Asked by
Dursun
Top achievements
Rank 1
Answers by
Vera
Telerik team
Share this question
or