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
close icon

LoadDynamicItems throws ArgumentException

Hi there

I have  a problem with the SfDataPager and/or the SfDataGrid.

I have a collection of objects of the type DataModel. This model has a propertycalled ClientSubmitDate, which is bound to the column. When the sfDataPager doesn't load data OnDemand it works fine. But when using OnDemandLoading and LoadDynamicItems the problem occours.

I doesnt matter what type of collection I'm using, both ObservableCollection and List throws the error.

Exception Message: 
An exception of type 'System.ArgumentException' occurred in System.Core.dll but was not handled in user code

Additional information: 'ClientSubmitDate' is not a member of type 'System.Object'

Method Calling LoadDynamicItems:
       private async void sfDataPager_OnDemandLoading(object sender, Syncfusion.UI.Xaml.Controls.DataPager.OnDemandLoadingEventArgs args)
            var data = (await Controller.DatabaseController.GetDataModelsForFormModel(Form, false, args.PageSize, args.StartIndex));
            sfDataPager.LoadDynamicItems(0, data);

If you need a sample model, my DataModel class could (for this example) be expressed like:
    public class DataModel
        public DateTime ClientSubmitDate { get; set; }

Please notice, that the bindings work without problems when NOT loading data on demand. The datatype that I submit as a argument in LoadDynamicData both fails with List<DataModel> and ObservableCollection<DataModel>.

Thanks in advance.

3 Replies

PR Pradeepa R V Syncfusion Team March 7, 2014 12:59 PM UTC

Hi Nickey
We have analysed the reported issue with our sample;we are not able to reproduce the issue.Can you please revert us by modifying the sample I attached based on your application.This would be more helpful for us to serve you.

Please let us know if you have any concern.


Attachment: OnDemandPaging_9ce5d512.zip

NM Nicky Mogensen March 7, 2014 03:01 PM UTC

Hi Pradeepa.

I've been trying to reproduce the issue, and I found it.

It seems like, there is a difference in how events get called, when using OnDemandLoading and not, so it was some code, that I thought already was active, there became active and, told the grid to sort on a propertyname instead of a columnname.

So it was some 6 months old code that suddenly made the error.

I'm really sorry for the inconvenience. 

PR Pradeepa R V Syncfusion Team March 10, 2014 07:25 AM UTC

Hi Nickey

Thanks for your update.

We are glad  to hear that your issue has been  resolved.You can contact us at any time regarding any clarification.

As always we will be happy to assist you.



Live Chat Icon For mobile
Up arrow icon