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

NullReferenceException in RadListView with CollectionViewSource

1 Answer 81 Views
ListView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Justin
Top achievements
Rank 1
Justin asked on 26 Jan 2016, 07:13 PM

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}}"/>

1 Answer, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 28 Jan 2016, 09:44 AM
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
Tags
ListView
Asked by
Justin
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Share this question
or