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

Excel Export Grid looses header

5 Answers 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Scott Durrett
Top achievements
Rank 1
Scott Durrett asked on 11 May 2010, 02:59 PM
I'm trying to use the grid to export to excel.  After reviewing many different examples I am able to get the grid to work with a button, however, I want to use the little excel button on the grid located near the refresh.  Every example I've tried doesn't work for me.  When the button is clicked the grid flashes, and looses the header line that the button and refresh is on. 

I also loose the grid formatting and my edit links disappear. 

What am I missing?

5 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 11 May 2010, 03:46 PM
Hello Scott,

Please examine the following link:
Export from ajaxified grid

Best regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Scott Durrett
Top achievements
Rank 1
answered on 11 May 2010, 05:15 PM
Thanks Daniel,  I gave it a try.  still same results. 

0
Daniel
Telerik team
answered on 11 May 2010, 05:58 PM
Hello Scott,

This approach will work flawlessly except if you have multiple nested AJAX controls:
<script type="text/javascript">
   function onRequestStart(sender, args)
   {
       if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0)
           args.set_enableAjax(false);
   }
</script>

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" ClientEvents-OnRequestStart="onRequestStart">
    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1">
        <MasterTableView CommandItemDisplay="Top">
            <CommandItemSettings ShowExportToExcelButton="true" />
        </MasterTableView>
    </telerik:RadGrid>
</telerik:RadAjaxPanel>

If the problem still persists, please submit a support ticket and attach a runnable copy of your project so I can debug it locally.

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Scott Durrett
Top achievements
Rank 1
answered on 12 May 2010, 10:50 AM
Daniel,

I'm not using the AjaxPanel, is that my problem?
0
Daniel
Telerik team
answered on 13 May 2010, 08:30 PM
Hello Scott,

In almost all cases, this behavior is result of exporting from ajaxified button. I don't know whether you use RadAjaxPanel, RadAjaxManager or ASP.NET UpdatePanel  - if you post some sample code or provide some more information I could give more to-the-point suggestion.

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Scott Durrett
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Scott Durrett
Top achievements
Rank 1
Share this question
or