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

null reference exception in ExportToCSV method

I am trying to add button action to export contents of my dataGrid to a csv file.
In trying to follow simple code example I found, I get null reference exception.
I have added Syncfusion.GridConverter.Wpf, Syncfusion.XlsIO.Base and Syncfusion.XlsIO.Wpf references to project

Can you tell what is wrong from attached screen capture ?

Attachment: Capture_de5beedb.7z

5 Replies

SP Sowndaiyan Paulpandi Syncfusion Team February 19, 2016 10:44 AM UTC

Hi Steve,

Thanks for contacting Syncfusion Support.

We have prepared
the sample for converting the GridDataControl in the CSV file. This sample working fine without any exception from our side. We have attached our tested sample in the below location, please revert by modifying the attached sample based on your application along with the replication procedure and also could you please share the details about which Syncfusion Version you have used in your application?. It will be helpful for us to analyze further. 

Sample : http://www.syncfusion.com/downloads/support/forum/122130/ze/CSV_Export_Demo-1139533253



SM Steve McWilliams February 19, 2016 04:27 PM UTC

I use VisualStudio 2013, but I have an older version of Syncfusion (Essential Studio ), which is probably the main problem.
I can't try upgrading until next week, but after that maybe everything will work OK.

Anyway, I got a XAML parsing exception trying to run your example directly.
Then I tried just revising my code to use the Command and CommandTarget on the exportEventsButton, as your sample does, but I could not get it to accept the <syncfusion.LayoutControl.GridView> element, even though I have Syncfusion.SampleLayout reference loaded.

I tried just executing the code in the ExportAllToCSV method in my button click method, but then I got the 'No entry point found' error shown in attached JPG.
In case it helps, I attached the relevant xaml and xaml.cs files I'm using.
 'runDataGrid' is name of GridDataControl and 'exportEventsButton' is the button, obviously. 

Attachment: ExportCSV_6643b6b7.7z

FP Farjana Parveen Ayubb Syncfusion Team February 22, 2016 01:07 PM UTC

Hi Steve,

Please let us know once you have upgraded from to our latest version.

We have checked the reported issue “Exception throws while export to CSV” on our end with your XAML and CS files and in your current version( But GridDataControl is exported into CSV without any exception.

Please refer the below sample which we are tried to reproduce the issue,

Sample Location: Export_to_CSV

Please check this issue once your upgraded to our latest version and let us know if you still facing the same issue.

Farjana Parveen A

SM Steve McWilliams February 23, 2016 09:10 PM UTC

I upgraded to latest version and now the Export function is working great.
Thanks for your help.

SP Sowndaiyan Paulpandi Syncfusion Team February 24, 2016 09:03 AM UTC

Hi Steve,

Thanks for the update.

Please let us know if you need further assistance.

Live Chat Icon For mobile
Up arrow icon