We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DataGrid is throwing ArgumentNullException on setting ItemsSource

I have a SfDataGrid in my page and when I try to set the ItemsSource to an ObservableCollection from the C# code behind it throws that exception with a stacktrace of this:

   at System.Reflection.RuntimeReflectionExtensions.CheckAndThrow(MethodInfo m)
   at System.Reflection.RuntimeReflectionExtensions.GetRuntimeBaseDefinition(MethodInfo method)
   at Syncfusion.Data.PropertyAccessor.InitializeGet(PropertyInfo propertyInfo)
   at Syncfusion.Data.PropertyAccessor..ctor(PropertyInfo propertyInfo)
   at Syncfusion.Data.ItemPropertiesProvider..ctor(ICollectionViewAdv view)
   at Syncfusion.UI.Xaml.Grid.GridItemPropertiesProvider..ctor(ICollectionViewAdv view, SfDataGrid _dataGrid)
   at Syncfusion.UI.Xaml.Grid.GridQueryableCollectionViewWrapper.CreateItemPropertiesProvider()
   at Syncfusion.Data.CollectionViewAdv.SetItemProperties(IEnumerable dataSource)
   at Syncfusion.Data.CollectionViewAdv.InitiateCollectionViewAdv()
   at Syncfusion.Data.CollectionViewAdv..ctor(IEnumerable _source)
   at Syncfusion.Data.QueryableCollectionView..ctor(IEnumerable source)
   at Syncfusion.UI.Xaml.Grid.GridQueryableCollectionViewWrapper..ctor(IEnumerable source, SfDataGrid grid)
   at Syncfusion.UI.Xaml.Grid.SfDataGrid.CreateCollectionViewAdv(IEnumerable source, SfDataGrid dataGrid)
   at Syncfusion.UI.Xaml.Grid.SfDataGrid.SetSourceList(Object itemsSource)
   at Syncfusion.UI.Xaml.Grid.SfDataGrid.OnItemsSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
   at Syncfusion.UI.Xaml.Grid.GridPropertyMetadata.OnDependencyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at Syncfusion.UI.Xaml.Grid.GridPropertyMetadata.OnInternalDependencyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at Windows.UI.Xaml.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Syncfusion.UI.Xaml.Grid.SfDataGrid.set_ItemsSource(Object value)
   at Documentation.Pages.Patients.LoadPage()
   at Documentation.Pages.Patients.<CommandsRequested>b__1()
   at Documentation.Controls.SettingsFlyouts.MainViewSettings.cbsfg_Checked(Object sender, RoutedEventArgs e)

Any help is appreciated.

3 Replies

NJ Narayanasamy J Syncfusion Team November 25, 2013 06:02 AM UTC

Hi Jeremy,

Thanks for using Syncfusion products.

We have analysed the reported issue with our sample; we are not able to reproduce the issue. Could you please revert us by modifying the sample based on your application along with the replication procedure? This would be helpful for us to serve you.

Sample: WinRT_Sample.zip

Please let us know if you need further assistance.



JS Jeremy Shore NO LONGER WITH COMPANY November 25, 2013 10:29 PM UTC

I can't seem to reproduce it in your project, but I can't get rid of it in mine. I will let you know if I find out how to reproduce.

NJ Narayanasamy J Syncfusion Team November 26, 2013 06:50 AM UTC

Hi Jeremy,

Thank you for your update and we will wait to hear from you.



Live Chat Icon For mobile
Up arrow icon