NullReferenceException in RadListView with CollectionViewSource

2 posts, 0 answers
  1. Justin
    Justin avatar
    1 posts
    Member since:
    Jan 2016

    Posted 26 Jan Link to this post

    Hello,

    I'm hitting a null reference exception when trying to set my ItemsSource to a CollectionViewSource. This same code works when using the built in listview but I'm getting this exception when using the RadListView. Can you please let me know if I'm trying to do something unsupported here?

     Exception:

    System.NullReferenceException: Object reference not set to an instance of an object.
       at Telerik.UI.Xaml.Controls.Data.RadListView.get_ShouldDisplayEmptyContent()
       at Telerik.UI.Xaml.Controls.Data.RadListView.Telerik.UI.Xaml.Controls.Data.ListView.IOrientedParentView.Measure(IGeneratedContainer container, RadSize availableSize)
       at Telerik.UI.Xaml.Controls.Data.ListView.Model.LayoutController.MeasureEmptyContent(RadSize size)
       at Telerik.UI.Xaml.Controls.Data.ListView.Model.LayoutController.Meas

     Code:

    <UserControl.Resources>
            <CollectionViewSource x:Name="CvsSections"
                                  Source="{Binding Sections}"
                                  IsSourceGrouped="True"
                                  ItemsPath="Items"/>
             
        </UserControl.Resources>

    <data:RadListView ItemsSource="{Binding Source={StaticResource CvsSections}}"/>

  2. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 28 Jan Link to this post

    Hi Justin,

    Thank you for contacting us! Currently, RadListView does not support CollectionViewSource as ItemsSource. We have some ideas of implementing this in future, but we do not have fixed timeframe.

    If you are looking for displaying data in groups you can feed the listview with flat IEnumerable and add group descriptors - http://docs.telerik.com/windows-universal/controls/radlistview/features/listview-grouping

    Let us know if this helps.

    Regards,
    Tsvyatko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top