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

export data from footer template

1 Answer 104 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shubham
Top achievements
Rank 1
Shubham asked on 12 Feb 2014, 08:25 AM
Hi All ,
            I have a radgrid which have child grid in which I have Footer template when I am exporting it by using "OnExcelMLExportRowCreated"   event I am unable to get  these items from footer template . and also unable  to get  the items of groupFooter template

 <telerik:GridTemplateColumn HeaderText="column" UniqueName="column" SortExpression="Subtotal" FooterStyle-HorizontalAlign="Right" FooterAggregateFormatString="{0:0.000}">
                                                                <HeaderStyle Wrap="false" Width="230px" />
                                                                <ItemStyle Wrap="false" HorizontalAlign="Right" />
                                                                <ItemTemplate>
                                                                    <asp:Label runat="server" ID="requestTotalLabel" Text='<%#Eval("total") %>'></asp:Label>
                                                                </ItemTemplate>
                                                                <FooterTemplate>
                                                                    <table width="100%">
                                                                        <tr>
                                                                            <td style="white-space: nowrap">
                                                                                <asp:Label runat="server" ID="requestTotalLabel" Text="request column:"></asp:Label>
                                                                            </td>
                                                                            <td>
                                                                                <telerik:RadNumericTextBox runat="server" ID="requestTotalRadNumericTextBox" ReadOnly="true"
                                                                                    Width="100px" EnabledStyle-HorizontalAlign="Right" NumberFormat-DecimalDigits="3" CssClass="AlignedRadNumericTextBox">
                                                                                </telerik:RadNumericTextBox>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td style="white-space: nowrap">
                                                                                <asp:Label runat="server" ID="addressLabel" Text="address:"></asp:Label>
                                                                            </td>
                                                                            <td>
                                                                                <telerik:RadNumericTextBox runat="server" ID="addressRadNumericTextBox" ReadOnly="true"
                                                                                    Width="100px" EnabledStyle-HorizontalAlign="Right" NumberFormat-DecimalDigits="3" CssClass="AlignedRadNumericTextBox">
                                                                                </telerik:RadNumericTextBox>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td style="white-space: nowrap">
                                                                                <asp:Label runat="server" ID="TaxesLabel" Text="Taxes:"></asp:Label>
                                                                            </td>
                                                                            <td>
                                                                                <telerik:RadNumericTextBox runat="server" ID="TaxesRadNumericTextBox" ReadOnly="true"
                                                                                    Width="100px" EnabledStyle-HorizontalAlign="Right" NumberFormat-DecimalDigits="3" CssClass="AlignedRadNumericTextBox">
                                                                                </telerik:RadNumericTextBox>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td colspan="2">
                                                                                <hr />
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td style="white-space: nowrap">
                                                                                <asp:Label runat="server" ID="requestTotalLabel" Text="request Total:"></asp:Label>
                                                                            </td>
                                                                            <td>
                                                                                <telerik:RadNumericTextBox runat="server" ID="requestTotalRadNumericTextBox" ReadOnly="true"
                                                                                    Width="100px" EnabledStyle-HorizontalAlign="Right" NumberFormat-DecimalDigits="2" CssClass="AlignedRadNumericTextBox">
                                                                                </telerik:RadNumericTextBox>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </FooterTemplate>
                                                            </telerik:GridTemplateColumn>


on code behind I am accessing it as 
 foreach (GridGroupFooterItem item in RadGrid.MasterTableView.GetItems(GridItemType.GroupFooter))
            {
                //set the colspan, so that the template cells are aligned with the grid columns
                for (int i = 0; i <= item.Cells.Count - 1; i++)
                {
                    (item.Cells[i] as TableCell).ColumnSpan = 1;
                }
                //color the footer labels based on the group index
                //SetFooterLabelsColor(item);
            }
 foreach (GridGroupFooterItem item in OrderLineItemsRadGrid.MasterTableView.GetItems(GridItemType.GroupFooter))
            {
                //set the colspan, so that the template cells are aligned with the grid columns
                for (int i = 0; i <= item.Cells.Count - 1; i++)
                {
                    (item.Cells[i] as TableCell).ColumnSpan = 1;
                }
              
            }



thanks





1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 17 Feb 2014, 06:54 AM
Hi Shubham,

I have to say that the behavior experienced is expected since the ExcelML format will export only the data in the grid and not the controls in it. That said if you want to export the controls as well I would suggest using a different format.

Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
General Discussions
Asked by
Shubham
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or