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.
Unfortunately, activation email could not send to your email. Please try again.

Grid to excel problem

Thread ID:





67630 Aug 25,2007 06:21 AM Sep 5,2007 05:09 PM Windows Forms 3
Tags: GridControl
Asked On August 25, 2007 06:21 AM


I have written two methods for exporting grid to excel.

in first one I have created my own custom class inheriting GridExcelConverterBase class.

in the second method i simply initilize an object of GridExcelConverter and call its gridToExcel method.

they both work fine but when I used any method and export the grid to excel, then other method starts to throw an exception
"type initilizer threw an exception".

and it is true for both side i.e. the method called first will work fine, and other one will start throwing exception.

sample solution is attached,
thanks syncfusion...


Rajagopal [Syncfusion]
Replied On August 29, 2007 12:57 AM

Hi Alia,

Thanks for your interest in Syncfusion Products.

When a class initializer fails to initialize a type, a TypeInitializationException is created and passed a reference to the exception thrown by the type's class initializer. The InnerException property of TypeInitializationException will hold information on the underlying exception. Please take a look at the InnerException property of the TypeInitializationException. I will get back to you with the fixed version of the sample by tomorrow with more information.


Replied On August 31, 2007 11:16 AM


Rajagopal [Syncfusion]
Replied On September 5, 2007 05:09 PM

Hi Alia,

Sorry for the delay in getting back to you.

We have made a few chnages to your sample code and the below modifed sample works fine without any exception

Let me know if this helps.


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.

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.