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

Export to Excel

Thread ID:





95491 Jul 13,2010 08:18 AM UTC Sep 21,2010 09:32 PM UTC Silverlight 6
Tags: GridControl
Faizal Ahmd
Asked On July 13, 2010 08:18 AM UTC

I am using the silver light syncfusion grid. I want to export the grid contents to excel.But grid.model.exporttoexcel funtion is not enabled for me.Any help would be appreciated

Kamalakannan A [Syncfusion]
Replied On July 24, 2010 09:06 PM UTC

Hi Fizal,

You need to add the following namespace to call the method "Model.ExportToExcel(ExcelVersion.Excel97to2003)".

Namespace : Syncfusion.Windows.Controls.Grid.Converter;

Let us know if you need any more information.


Tigger Tag
Replied On August 27, 2010 03:14 PM UTC


Model.ExportToExcel(ExcelVersion.Excel97to2003) function is opening File Save Dialog box, How do I get the Stream from the ExportToExcel function and not display the File Save Dialog box.


Tigger Tag
Replied On August 30, 2010 03:12 PM UTC

Can anyone answer my question, I want to export the grid data in Excel format, I want to get the Stream object for the export method and not the current File Save As Dialog that creates excel file on the client machine. I have a requirement to store the grid data (with excel like formatting) into a database column and display the same at a later stage. This is a make or break feature for the prototype project I am developing. I would appreciate if you could give a quick solution so that we could make the decision.

Thanks in advance.

Kamalakannan A [Syncfusion]
Replied On September 7, 2010 12:43 PM UTC

Hi Tigger,

Thank you for using Syncfusion products.

Grid can be exported to excel without save dialog box using grid.ExportToExcel() method.

Please refer the sample in the following link

Sample: http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=sample944676633.zip

Let us know if any queries.


Tigger Tag
Replied On September 14, 2010 07:03 PM UTC

Is there a way to export to Excel to a Stream (like Memory Stream) instead of specifying a file name? I want to store the excel file in the database instead of a file. The sample you attached shows me how to save it to a file without showing the dialog box, if I am able to get a Memory Stream out of it would be great.


Kamalakannan A [Syncfusion]
Replied On September 21, 2010 09:32 PM UTC

Hi Fizal,

Thanks for your update.

Silverlight Grid Control does not export the underlying source as a collection to an object. This can be achieved only by defining an object for the underlying source class and collect the cell values to the object using grid model as follows.

[Code snippet] [C#]

private void Exportbutton_Click(object sender, RoutedEventArgs e)
List Source = new List();
GridModel Gridmodel = this.grid.Model;
for (int i = 0; i < grid.Model.RowCount; i++)
griddata rowdata = new griddata();
rowdata.col1 = Gridmodel[i, 0].CellValue.ToString();
rowdata.col2 = Gridmodel[i, 1].CellValue.ToString();

Please find the attached sample for your reference.

Sample: Silverlight_GridControl1404564019.zip

Let us know if you need any more information.



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

This page will automatically be redirected to the 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