Hi,
What I'm trying to achieve sound pretty simple considering the features offered by ASP.NET AJAX.
I have an aspx page with a RadAjaxManager. This manager "ajaxifies" the loading of usercontrols within that page.
I'm loading a usercontrol embedding a RadGrid and everything works like a charm (as expected). Then I'm trying to export the grid to an Excel spreadsheet and nothing happens.
I tried many different options as described on this page but it still doesn't work.
Here's a sample of my Default.aspx page with the RadAjaxManager
Here's the code behind:
I have a ribbon bar on top of my page to load the different usercontrols.
Here is my data-summaries.ascx:
and there is nothing in the code behind as I don't need anything that is described in this WORKING example.
Don't know what to do now :(
What I'm trying to achieve sound pretty simple considering the features offered by ASP.NET AJAX.
I have an aspx page with a RadAjaxManager. This manager "ajaxifies" the loading of usercontrols within that page.
I'm loading a usercontrol embedding a RadGrid and everything works like a charm (as expected). Then I'm trying to export the grid to an Excel spreadsheet and nothing happens.
I tried many different options as described on this page but it still doesn't work.
Here's a sample of my Default.aspx page with the RadAjaxManager
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" > <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadRibbonBarAdminTools"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="PContent" LoadingPanelID="RadAjaxLoadingContextPanel"> </telerik:AjaxUpdatedControl> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings></telerik:RadAjaxManager><telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingContextPanel" runat="server"></telerik:RadAjaxLoadingPanel><asp:Panel ID="PContent" runat="server"></asp:Panel>Here's the code behind:
protected void Page_Load(object sender, EventArgs e){ if (LatestLoadedControlName != null) { LoadUserControl(LatestLoadedControlName); }}protected void RadRibbonBar_ButtonClick(object sender, RibbonBarButtonClickEventArgs e){ switch (e.Button.Text) { case "Summarized": LoadUserControl("usercontrols/data-Summaries.ascx"); break; default: if (LatestLoadedControlName != null) { Control previousControl = PContent.FindControl(LatestLoadedControlName.Replace("usercontrols/", "").Split('.')[0]); if (!Object.Equals(previousControl, null)) { this.PContent.Controls.Remove(previousControl); } } break; }}public void LoadUserControl(string controlName){ if (LatestLoadedControlName != null) { Control previousControl = PContent.FindControl(LatestLoadedControlName.Replace("usercontrols/", "").Split('.')[0]); if (!Object.Equals(previousControl, null)) { this.PContent.Controls.Remove(previousControl); previousControl.Dispose(); } } string userControlID = controlName.Replace("usercontrols/", "").Split('.')[0]; Control targetControl = PContent.FindControl(userControlID); if (Object.Equals(targetControl, null)) { UserControl userControl = (UserControl)this.LoadControl(controlName); userControl.ID = userControlID.Replace("/", "").Replace("~", ""); this.PContent.Controls.Add(userControl); LatestLoadedControlName = controlName; }}protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e){}I have a ribbon bar on top of my page to load the different usercontrols.
Here is my data-summaries.ascx:
<telerik:RadGrid ID="rgIGTSummaryGrid" runat="server" DataSourceID="dsIGTDataSummary" AllowSorting="true" AllowPaging="true" PageSize="20" AutoGenerateColumns="false"> <PagerStyle Visible="false" /> <MasterTableView TableLayout="Auto" CommandItemDisplay="Top"> <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="false" /> <Columns> <telerik:GridBoundColumn DataField="Username" HeaderText="Participant ID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Time" HeaderText="Date"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Sex" HeaderText="Gender"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Age" HeaderText="Age"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="YoE" HeaderText="Education"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Start" HeaderText="Start"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Gain" HeaderText="Overall Gain"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Currency" HeaderText="Currency"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="NbDeck" HeaderText="#Deck"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="DeckOrder" HeaderText="Deck Display Order"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="A" HeaderText="#A Pick"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="B" HeaderText="#B Pick"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="C" HeaderText="#C Pick"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="D" HeaderText="#D Pick"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="DeckA_Output" HeaderText="Deck A Overall output"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="DeckB_Output" HeaderText="Deck B Overall output"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="DeckC_Output" HeaderText="Deck C Overall output"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="DeckD_Output" HeaderText="Deck D Overall output"> </telerik:GridBoundColumn> </Columns> </MasterTableView> <ExportSettings HideStructureColumns="false" IgnorePaging="true" OpenInNewWindow="true"> <Excel Format="Biff" /> </ExportSettings> <ClientSettings> <Scrolling AllowScroll="true" UseStaticHeaders="true" /> </ClientSettings></telerik:RadGrid><telerik:RadAjaxLoadingPanel ID="ralpIGTSummaryGrid" runat="server"></telerik:RadAjaxLoadingPanel><asp:SqlDataSource ID="dsIGTDataSummary" runat="server" ConnectionString="<%$ ConnectionStrings:NRPMonitorDB %>" SelectCommand="P_GetIGT_SummaryData" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:Parameter Name="sid" DefaultValue="1" /> </SelectParameters></asp:SqlDataSource>and there is nothing in the code behind as I don't need anything that is described in this WORKING example.
Don't know what to do now :(