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 when export treegrid to Pdf

Thread ID:





127970 Dec 22,2016 08:47 AM UTC Jan 2,2017 11:50 AM UTC ASP.NET MVC 3
Tags: TreeGrid
Mohamed Salah
Asked On December 22, 2016 08:47 AM UTC

if parent data include 'ID, Name, child<>' and each child data include 'ID, Name , Details'.
Error appear Null Reference Exception 


Jonesherine Stephen [Syncfusion]
Replied On December 23, 2016 09:31 AM UTC

Hi Salah, 
We regret for the inconvenience caused. 
We have analysed the reported issue with our sample. We are unable to reproduce the issue. Can you please revert us by modifying the sample based on your application along with the replication procedure? This would be helpful for us to serve you. 
Disclaimer: We have removed bin and obj folder in the given sample for some security reasons, we must include necessary dlls to export TreeGrid control which is available in Essential Studio installed location. 
Jone sherine P S 

Mohamed Salah
Replied On December 28, 2016 09:38 AM UTC

This is my sample. I wish that help you.

Attachment: excelexport_5365b270.rar

Mahalakshmi Karthikeyan [Syncfusion]
Replied On January 2, 2017 11:50 AM UTC

Hi Salah, 
Sorry for the inconvenience caused. 
We have analyzed the given sample and came to know that the issue is because the child class didn’t have the definition for “subtasks” to specify its child. It is mandatory to define this property in both the parent and child classes to know its child count while exporting. Please find the below code example for details. 
public class child 
    public List<child> subtasks { get; set; } 
We have also modified the sample and you can find the sample from the following location. 
Mahalakshmi K. 


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