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

TreeListView shows partial rows when ItemsSource is set via ValueConverter

3 Answers 29 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Hasanain
Top achievements
Rank 1
Hasanain asked on 01 Aug 2012, 12:29 PM
Hello,

I have a TreeListView which is supposed to show a collection with different filters applied in two view states, the states are maintained by one bool property in the view model.

The value converter works correctly in that I can see the values being passed and returned, and in one of the states all items in the collection are shown correctly in the view. When switching back to the previous state, and the second collection view is bound, only a few of the rows are shown, even though this second collection contains the required number rows.

<telerik:RadTreeListView.ItemsSource><br>               
<
MultiBinding Converter="{StaticResource IsExpandedToCollectionViewConverter}">
                    <Binding Path="IsExpanded"/>
                    <Binding Path="DataContext" RelativeSource="{RelativeSource AncestorType=Grid}"/>
        </MultiBinding>
</telerik:RadTreeListView.ItemsSource>


The above code shows how the ItemsSource is bound, the IsExpanded property maintains the state is a boolean, and DataContext is the viewModel with the two collection view properties.

The two collectionview sources are SummaryView and SortedView. When the control is first loaded, the summary view is shown, when expanded the SortedView is shown. 

Additionally, if the SummaryView is empty, then the Visibility of the treelistview is set to collapsed. In the expanded view the treelistview, the visibility however works fine.

Thank You

Hasanain



3 Answers, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 02 Aug 2012, 09:53 AM
Hi Hasanain,

 
Will it be possible to open a support ticket and to send a simple runnable project demonstrating the problem? We will debug it on our side in order to find what is causing the described behavior.
Please take a look at this blog post for a reference on how to isolate an issue in a sample project.

Thank in advance.


Greetings,
Vera
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Hasanain
Top achievements
Rank 1
answered on 02 Aug 2012, 09:51 PM
I managed to isolate the problem by setting up two separate CollectionViews using the CollectionViewSource. Earlier when I reported the problem, the two separate ListCollectionView properties were referencing the same underlying collection view of the common ObservableCollection not two different ones. As a result when I switched or removed filters on each of the two properties it would affect the other one, hence the partial rows and incorrect view.

By creating two separate collection views, I was able to remove the interference and solve the rows problem.

Thanks

Hasanain



0
Vera
Telerik team
answered on 03 Aug 2012, 01:45 PM
Hello Hasanain,

 
Just to make sure, is the found solution appropriate for your case? Let us know in case further assistance is needed.

Regards,
Vera
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

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