On submit the grid is binding with excel version without open excel application.
This is ASCX file:
----------------------------------------------------------------------------------------------------------------------------------------------------
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function mngRequestStarted(ajaxManager, eventArgs) {
if (eventArgs.EventTarget == "mngBtnExcel") {
eventArgs.EnableAjax =
false;
}
}
</script>
</
telerik:RadCodeBlock>
<
asp:Button ID="mngBtnExcel" runat="server" Text="EXPORT GRID" OnClick="Vai" />
<telerik:RadGrid ShowStatusBar="true" EnableAJAX="True"
ID="RadGrid1" runat="server" Width="97%" Skin="Web20"
AllowPaging="True" AllowSorting="true" AllowMultiRowSelection="True"
AutoGenerateColumns="true" GroupingEnabled="true" ShowGroupPanel="true"
GridLines="Both" >
<ClientSettings ColumnsReorderMethod="Swap" ReorderColumnsOnClient="true"
AllowColumnsReorder="true" AllowDragToGroup="true">
<Selecting AllowRowSelect="True"></Selecting>
<Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True"
ResizeGridOnColumnResize="False"></Resizing>
</ClientSettings>
<GroupPanel Text="Per raggruppare secondo una colonna, trascinare l'intestazione della colonna su quest'area "></GroupPanel>
<MasterTableView Width="100%" />
<PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" Position="TopAndBottom"/>
<FilterMenu EnableTheming="True">
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
</telerik:RadGrid>
<telerik:RadAjaxLoadingPanel Skin="Web20" ID="RadAjaxLoadingPanel1" runat="server">
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
<ClientEvents OnRequestStart="mngRequestStarted"/>
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1" >
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
----------------------------------------------------------------------------------------------------------------------------------------------------------
Is very simple and i disabled AJAX function how you can see.
Now this is the code of APSX page to import usercontrol in code behind:
---------------------------------------------------------------------------------------------------------------------------------------------------
Dim userControl As New asxc_Griglia25
UserControl = LoadControl(
"Griglia.ascx")
UserControl.ID =
"Griglia"
updCaricaGriglia.ContentTemplateContainer.Controls.Add(userControl)