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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

null reference exception in ExportToCSV method

Thread ID:





122130 Feb 18,2016 03:28 PM UTC Feb 24,2016 09:03 AM UTC WPF 5
Tags: GridDataControl
Steve McWilliams
Asked On February 18, 2016 03:28 PM UTC

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

Sowndaiyan Paulpandi [Syncfusion]
Replied On 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



Steve McWilliams
Replied On 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

Farjana Parveen Ayubb [Syncfusion]
Replied On 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

Steve McWilliams
Replied On February 23, 2016 09:10 PM UTC

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

Sowndaiyan Paulpandi [Syncfusion]
Replied On February 24, 2016 09:03 AM UTC

Hi Steve,

Thanks for the update.

Please let us know if you need further assistance.


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon