This is a migrated thread and some comments may be shown as answers.

[Solved] Problem for Export to Excel

2 Answers 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Enoch Kuang
Top achievements
Rank 1
Enoch Kuang asked on 02 Feb 2010, 10:03 PM
Hi,

I have a LinkButton outside of RadGrid for triggering Export to Excel.

 

 

 

 

public

 

void LinkButtonExportToExcel_click(object sender, EventArgs e)

 

{

 

int rowCount = RadGridProduct.Items.Count;

 

 

if (rowCount <= 0) { return; }

 

RadGridProduct.ExportSettings.ExportOnlyData =

true;

 

RadGridProduct.ExportSettings.IgnorePaging =

false;

 

RadGridProduct.ExportSettings.OpenInNewWindow =

true;

 

RadGridProduct.MasterTableView.ExportToExcel();

}

It worked fine before but not now. After I clicked the LinkButton, no Excel opened in the new window and my RadGid had lost all of Filter controls and other controls inside ItemTemplates. Am I missing something?

 

Thanks,

Enoch

 

 

 

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 03 Feb 2010, 04:19 AM
Hello Enoch,

Is your RadGrid ajax-enabled? The export feature of the grid works only with regular postbacks and not with ajax. But if you want to export data form an ajaxified grid, the following document should provide you with necessary insights. Take a look at it.
Export from ajaxified grid

Hope this helps..
Princy.
0
Enoch Kuang
Top achievements
Rank 1
answered on 03 Feb 2010, 01:53 PM
Princy,

That fixes my problem. Thanks a lot!

Enoch
Tags
Grid
Asked by
Enoch Kuang
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Enoch Kuang
Top achievements
Rank 1
Share this question
or