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

hide footer during export

1 Answer 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
MBEN
Top achievements
Rank 2
Veteran
MBEN asked on 26 Nov 2011, 11:28 PM
I have a grid in which I display column totals in the footer.
Below is the declaration of my grid column.
<telerik:GridTemplateColumn UniqueName="EndBalance" HeaderText="Ending Balance" ItemStyle-HorizontalAlign="Right"
                                FooterStyle-HorizontalAlign="Right">
                                <ItemTemplate>
                                    <asp:HyperLink ID="linkEndBalance" runat="server" Text='<%# Eval("EndBalanceDollars")%>'></asp:HyperLink>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:HyperLink ID="linkEndBalanceTotal" runat="server"></asp:HyperLink>
                                    <br />
                                    <asp:HyperLink ID="linkEndBalanceGrandTotal" runat="server"></asp:HyperLink>
                                </FooterTemplate>
                            </telerik:GridTemplateColumn>

I am having troubles with the footer when exporting the grid.
The total and the grand total columns overlap each other and are not displayed on separate lines.

I have my exportonlydata set to true.

How can I get the line break in the footer.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Nov 2011, 05:18 AM
Hello,

One suggestion is you can hide footer in ItemCommand event as shown below.
C#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
 if (e.CommandName == RadGrid.ExportToExcelCommandName)
{
   GridFooterItem item = (GridFooterItem)RadGrid1.MasterTableView.GetItems(GridItemType.Footer)[0];
  item.Visible = false;
}
}

-Shinu.
Tags
Grid
Asked by
MBEN
Top achievements
Rank 2
Veteran
Answers by
Shinu
Top achievements
Rank 2
Share this question
or