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

[Solved] Export from Ajaxified grid in UserControl

2 Answers 111 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
kachy
Top achievements
Rank 1
kachy asked on 22 Jul 2009, 07:43 PM
Hi,

I am trying to achieve the functionality shown in
http://demos.telerik.com/aspnet-ajax/tabstrip/examples/applicationscenarios/loadondemand/defaultcs.aspx

I am able to make my tab and multipage work as shown in the above example. I also want to have the export option for the grids which load from the usercontrol. Can you please suggest what can I do in this scenario. For Ajaxified grid, we have to cancel the AJAX as suggested in the examples I got from the following link:
http://www.telerik.com/community/code-library/aspnet-ajax/general/export-radgrid-content-to-excel-word-csv-pdf-with-ajax-enabled.aspx

How can I refer to the button control defined in the usercontrol page which starts the export process to cancel the AJAX for that process? AJAX Manager is ajaxifying the whole tab in this load on demand example, so can I refer to the button in usercontrol ?

<

 

telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="RadTabStrip1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />

 

 

<telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

<telerik:AjaxSetting AjaxControlID="RadMultiPage1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

</

 

telerik:RadAjaxManager>

 



Can you please suggest what can I do in this scenario?


Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 23 Jul 2009, 06:23 AM
Hi,

You can use the OnRequest client event of the RadAjaxManager, access the button in the client event and disable ajax as shown below:
aspx:
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" ClientEvents-OnRequestStart="onRequestStart">         
     <AjaxSettings> 
           <telerik:AjaxSetting AjaxControlID="RadTabStrip1" > 

js:
function onRequestStart(ajaxPanel, eventArgs) 
        {         
            if (eventArgs.get_eventTarget().indexOf("Button1") >= 0) 
                eventArgs.set_enableAjax(false); 
        }   

Thanks
Princy.
0
kachy
Top achievements
Rank 1
answered on 23 Jul 2009, 01:17 PM
Thanks a lot. It worked.
Tags
Ajax
Asked by
kachy
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
kachy
Top achievements
Rank 1
Share this question
or