TreeListView shows partial rows when ItemsSource is set via ValueConverter

4 posts, 0 answers
  1. Hasanain
    Hasanain avatar
    8 posts
    Member since:
    Jun 2012

    Posted 01 Aug 2012 Link to this post

    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



  2. Vera
    Admin
    Vera avatar
    263 posts

    Posted 02 Aug 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Hasanain
    Hasanain avatar
    8 posts
    Member since:
    Jun 2012

    Posted 02 Aug 2012 Link to this post

    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



  5. Vera
    Admin
    Vera avatar
    263 posts

    Posted 03 Aug 2012 Link to this post

    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.

Back to Top