Hi,
I am trying to export one of the Nested grid which is shown when expanding the parent grid meanwhile I am getting the following error
System.InvalidCastException: Unable to cast object of type 'Telerik.Web.Apoc.Layout.BlockArea' to type 'Telerik.Web.Apoc.Layout.AreaContainer'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.SystemException: System.InvalidCastException: Unable to cast object of type 'Telerik.Web.Apoc.Layout.BlockArea' to type 'Telerik.Web.Apoc.Layout.AreaContainer'.
at Telerik.Web.Apoc.Fo.Flow.BlockContainer.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area, Region region)
at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area)
at Telerik.Web.Apoc.Fo.Pagination.PageSequence.Format(AreaTree areaTree)
at Telerik.Web.Apoc.StreamRenderer.Render(PageSequence pageSequence)
at Telerik.Web.Apoc.Fo.FOTreeBuilder.EndElement()
at Telerik.Web.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)
Source Error:
Stack Trace:
I tested with only one column in my nested grid, eventhough i am getting the error.
My CS code is
So guide me to solve the issue
-Thanks
I am trying to export one of the Nested grid which is shown when expanding the parent grid meanwhile I am getting the following error
System.InvalidCastException: Unable to cast object of type 'Telerik.Web.Apoc.Layout.BlockArea' to type 'Telerik.Web.Apoc.Layout.AreaContainer'.
at Telerik.Web.Apoc.Fo.Flow.BlockContainer.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area, Region region)
at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area)
at Telerik.Web.Apoc.Fo.Pagination.PageSequence.Format(AreaTree areaTree)
at Telerik.Web.Apoc.StreamRenderer.Render(PageSequence pageSequence)
at Telerik.Web.Apoc.Fo.FOTreeBuilder.EndElement()
at Telerik.Web.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.SystemException: System.InvalidCastException: Unable to cast object of type 'Telerik.Web.Apoc.Layout.BlockArea' to type 'Telerik.Web.Apoc.Layout.AreaContainer'.
at Telerik.Web.Apoc.Fo.Flow.BlockContainer.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area, Region region)
at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area)
at Telerik.Web.Apoc.Fo.Pagination.PageSequence.Format(AreaTree areaTree)
at Telerik.Web.Apoc.StreamRenderer.Render(PageSequence pageSequence)
at Telerik.Web.Apoc.Fo.FOTreeBuilder.EndElement()
at Telerik.Web.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
I tested with only one column in my nested grid, eventhough i am getting the error.
<telerik:RadGrid ID="RadCustomer" runat="server" |
AutoGenerateColumns="false" AllowSorting="true" Skin="Vista" EnableLinqExpressions="false" |
Width="100%" OnItemDataBound="RadCustomer_ItemDataBound" OnNeedDataSource="RadCustomer_NeedDataSource" OnItemCreated="RadCustomer_ItemCreated" OnItemCommand="RadCustomer_ItemCommand"> |
<ExportSettings IgnorePaging="True" OpenInNewWindow="True"> |
<Pdf AllowCopy="True" PageTitle="PostingNotice Billing Report" Keywords="None" Subject="RadGrid Export" |
Author="Anonymous" PageHeight="8.5in" PageWidth="14in" Title="PostingNotice Billing Report" /> |
</ExportSettings> |
<PagerStyle Mode="NumericPages"></PagerStyle> |
<SortingSettings EnableSkinSortStyles="false" /> |
<ClientSettings AllowColumnHide="True" AllowRowHide="True" AllowColumnsReorder="True" |
ReorderColumnsOnClient="True"> |
<Resizing EnableRealTimeResize="True" ResizeGridOnColumnResize="True" AllowColumnResize="true" |
ClipCellContentOnResize="false"></Resizing> |
</ClientSettings> |
<MasterTableView TableLayout="Fixed" Name="Forms" GroupLoadMode="Client" EnableHeaderContextMenu="true" |
AllowSorting="true" AllowMultiColumnSorting="True" AllowCustomSorting="false" CommandItemDisplay="Top"> |
<HeaderStyle CssClass="HeaderStyle" /> |
<%--<ItemStyle CssClass="ItemStyle" /> |
<AlternatingItemStyle CssClass="AlternatingItemStyle" />--%> |
<NoRecordsTemplate> |
<div style="background-color: Silver; height: 20px; color: Red; text-align: center; |
font-size: 10pt; font-family: Verdana; font-weight: bold;"> |
<i>No forms defined for this application.</i> |
</div> |
</NoRecordsTemplate> |
<CommandItemTemplate> |
<table width="100%" class="RadCommandTable" style="padding: 0px;"> |
<tr> |
<td align="center"> |
<asp:Button ID="btnFormsExport" CommandName="lnkFormsExport" runat="server" Text="FExport" /> |
</td> |
</tr> |
</table> |
</CommandItemTemplate> |
<Columns> |
<telerik:GridTemplateColumn HeaderText="Jurisdiction" SortExpression="Name" |
DataField="Name" GroupByExpression="Name Group By Name" |
UniqueName="Jurisdiction"> |
<ItemTemplate> |
<asp:Label ToolTip='<%# Eval("Name") %>' Text='<%# Eval("Name") %>' ID="lblJuris" runat="server"></asp:Label> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
</Columns> |
</MasterTableView> |
</telerik:RadGrid> |
My CS code is
protected void RadCustomer_ItemCommand(object source, GridCommandEventArgs e) |
{ |
RadGrid selGrid = (RadGrid)source; |
if (e.Item is GridCommandItem) |
{ |
//ExportPDF button clicks |
if (e.CommandName == "lnkCustExport") |
{ |
//Setting the PDF flag to true |
isPdfExport = true; |
ConfigureSelectFormsPDFExport(selGrid); |
selGrid.MasterTableView.ExportToPdf(); |
e.Item.OwnerTableView.Rebind(); |
} |
} |
-Thanks