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.
Unfortunately, activation email could not send to your email. Please try again.

LoadDynamicItems throws ArgumentException

Thread ID:

Created:

Updated:

Platform:

Replies:

115965 Mar 6,2014 10:11 AM Mar 10,2014 03:25 AM WinRT 3
loading
Tags: SfDataPager
Nicky Mogensen
Asked On March 6, 2014 10:11 AM

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.

Pradeepa R V [Syncfusion]
Replied On March 7, 2014 07:59 AM

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.

Regards
Pradeepa



Attachment: OnDemandPaging_9ce5d512.zip

Nicky Mogensen
Replied On March 7, 2014 10:01 AM

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. 

Pradeepa R V [Syncfusion]
Replied On March 10, 2014 03:25 AM

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.

 Regards,

Pradeepa


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;