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

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

Regards,
M.Salah

3 Replies

JS Jonesherine Stephen Syncfusion Team 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. 
Regards, 
Jone sherine P S 



MS Mohamed Salah December 28, 2016 09:38 AM UTC

Hi, 
This is my sample. I wish that help you.
Regards,
M.Salah

Attachment: excelexport_5365b270.rar


MK Mahalakshmi Karthikeyan Syncfusion Team 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. 
Regards, 
Mahalakshmi K. 


Loader.
Up arrow icon