Windows Store App Argument Exception from SFDataGrid

Hi,

I've released an app to the Windows Store which uses a SyncFusion data grid. It works fine locally in both debug and release mode, but seems to intermittently crash for some of my users. The exception which keeps getting logged is:

stowed_exception_system.argumentexception_80070057_csvsplitter.dll!syncfusion::ui::xaml::grid::utility::bindingutility.createeditablebinding

The stack trace is:



I can't understand why this is occurring intermittently but works fine for most of my users. I have started to wonder if the problem is data related?

Any help you can provide would be much appreciated.

Mat

3 Replies

MA Mohanram Anbukkarasu Syncfusion Team July 15, 2020 12:31 PM UTC

Hi Mathew, 

Thanks for contacting Syncfusion support.  

We have checked the reported issue stack trace. It is hard for us to find the exact cause for the issue only with the provided stack trace. It seems the issue occurs on initial loading itself. Kindly provide the following details. 

  1. Type of the DataSource bouded to the DataGrid. (Like observable collection, DataTable)
  2. Code snippet of the creation of the SfDataGrid and its columns.
  3.  Code snippet of the event related customization in DataGrid if you have handled any DataGrid event.

These details will be more helpful for us to find the exact cause for the issue and to provide a prompt solution at earlier. 

Regards, 
Mohanram A. 



MA Mathew July 15, 2020 03:12 PM UTC

Hi Mohanram,

I'm so embarrassed by this issue sorry. I spent weeks investigating what was happening without success before logging this issue, but almost as soon as I saw your reply I figured out what the problem is.

What my program does is build a dynamic dataset of ExpandoObjects based on the contents of a CSV file. It then uses that dataset as the datasource for the grid. Each column in the grid is mapped to the column headings in the file, but I didn't add defensive code to strip out certain characters from headings. To prove that it was special characters causing the crash I set up a file with a column heading of "Price (pence)" and the exception occurred, changing the column heading in the file back to "Price pence" without brackets immediately fixed the problem.

I have added code to handle the AutoGeneratingColumn event, but this code itself isn't crashing, all this does is determine the style to use based on the column data type. Now I can replicate the problem and see it happen in debug mode I can see that the exception is raised immediately AFTER the AutoGeneratingColumn event is fired. I can't debug further than this though as it's within the SyncFusion package.

To fix this I've added some defensive code to strip non-alpha numeric characters from the mapped column name. And that fixes the problem :-) I might go a few steps further and set a maximum field name length, ensure it doesn't start with a number, etc.

When you think about this pragmatically, if someone tried to add a property to a class called "Price (pence)" the code wouldn't even compile. So trying to do the same at runtime was always going to fail.

Thanks for your very important thought provoking reply :-)

Mat


MA Mohanram Anbukkarasu Syncfusion Team July 16, 2020 01:23 PM UTC

Hi Mathew, 

Thanks for the update. 

We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 

You can also close this incident if you do not have any queries and rate your support experience. 

Regards, 
Mohanram A. 


Loader.
Up arrow icon