<telerik:RadAjaxPanel ID="RadAjaxPanel1" RestoreOriginalRenderDelegate="false" runat="server">
<asp:LinkButton ID="linkbuttonShowHide" runat="server" Text="Show Group Questions"
Font-Size="xx-small" Visible="false" CommandArgument='<%# Eval("QID") %>'
OnCommand="linkbuttonShowHide_Command" CommandName="Click" />
<asp:Panel ID="panel" Visible="false" runat="server">
<asp:GridView ID="gridview1" Visible="true" CssClass="tablescale" runat="server"
ShowHeader="false" ShowFooter="false" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="id" Visible="true" />
<asp:BoundField DataField="text" Visible="true" HtmlEncode="false" />
</Columns>
</asp:GridView>
</asp:Panel>
</telerik:RadAjaxPanel>
when the grid is first loaded the panel is not visible, then when the linkbutton is clicked it is opened with roughly the following code:
protected void linkbuttonShowHideRRQuests_Command(object sender, CommandEventArgs e)
{
LinkButton _lbShowRR = (LinkButton)sender;
GridView _gvRR = (GridView)((LinkButton)sender).Parent.FindControl("gridview1");
Panel _panelRR = (Panel)((LinkButton)sender).Parent.FindControl("panel");
if (_lbShowRR.Text != "Show Questions")
{
_lbShowRR.Text =
"Show Questions";
_gvRR.DataSource =
null;
_gvRR.DataBind();
_panelRR.Visible =
false;
}
else
{
_lbShowRR.Text =
"Hide Questions";
_gvRR.DataSource =
this.GroupQuestions;
_gvRR.DataBind();
_panelRR.Visible =
true;
}
}
When I add code to export the grid to excel where:
RadGrid.ExportSettings.ExportOnlyData =
true;
RadGrid.ExportSettings.IgnorePaging =
true;
RadGrid.ExportSettings.OpenInNewWindow =
true;
I am binding the data in the OnNeedDataSource event of the grid.
The issue I am having is that when RestoreOriginalRenderDelegate="false", the panel will not open, but when RestoreOriginalRenderDelegate="true", the panel will open but the export does not work correctly, I get the
Object reference not set to an instance of an object.
error that I have seen in a few other posts.
I have looked at a few posts and have tried setting the inheritance of the page to the RadAjaxPage and also try to implement IRadAjaxPage, none of this seems to work.
Is there any other work arounds where both can happen, I can export to excel and I can open the panel within the ajax panel?
Thanks for your help!
Aaron