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

Excel export stops working after sorting,paging or grouping

3 Answers 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
DrKawashima
Top achievements
Rank 1
DrKawashima asked on 02 Aug 2012, 04:07 AM
Hi Telerik team,
I have an issue with the Export to Excel-button. The button works fine until I perform an action on the radgrid (such as removing/adding columns, sorting or paging) - after that, the Export to Excel -button no longer has any effect.

My radgrid is ajaxified through a RadAjaxmanager. It does not reside in any kind of updatepanel. The grid is on a sharepoint page.

I've implemented the necessary disabling of ajax in the clickfunction of the button.
function onRequestStart(sender, args) {
    if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0) {
        args.set_enableAjax(false);
    }
}

So it seems like the button functionality is broken after an ajax request is made.
Any suggestions?

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 06 Aug 2012, 12:42 PM
Hello,

Please put a breakpoint in the onRequestStart event and check whether it fires as expected. Also, I'd like to see your AjaxManager settings if possible.

Regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
DrKawashima
Top achievements
Rank 1
answered on 13 Aug 2012, 02:59 PM
Hi,
after having performed actions on the grid, the javascript function onRequestStart does not fire at all when the Excel export button is clicked 
(Before the actions where performed the javascript fires as expected though)

Here is how I've set up the grid and the ajax settings:


protected override void OnInit(EventArgs e)
        {
            SetUpGrid();
            InitRadAjaxManager();
            AddColumnsToGrid();
        }




private void InitRadAjaxManager()
        {
            _radAjaxManager = RadAjaxManager.GetCurrent(this.Page);
            if (_radAjaxManager == null)
            {
                _radAjaxManager = new RadAjaxManager();
                this.Page.Form.Controls.Add(_radAjaxManager);
            }
   
            _radAjaxManager.ClientEvents.OnRequestStart = "onRequestStart";
   
            AjaxSetting s= new AjaxSetting();
            s.AjaxControlID = grid.ID;
            AjaxUpdatedControl updatedControl = new AjaxUpdatedControl();
           
updatedControl.ControlID = grid.ID;
            s.UpdatedControls.Add(updatedControl);
            _radAjaxManager.AjaxSettings.Add(s);
   
            _radAjaxManager.EnableAJAX = true; //<<<<
        }


0
Daniel
Telerik team
answered on 17 Aug 2012, 08:45 AM
Hello,

I'm unable to recreate your scenario on my end. Make sure that you cancel AJAX when exporting as suggested in the following topic:
Export from Ajaxified Grid
If the problem still exists, please provide a small, runnable demo or self-contained code so that I can try to reproduce the problem locally.

Best regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
DrKawashima
Top achievements
Rank 1
Answers by
Daniel
Telerik team
DrKawashima
Top achievements
Rank 1
Share this question
or