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

Hiding Caption in Export to Excel

1 Answer 160 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nagendra Thumuluru
Top achievements
Rank 1
Nagendra Thumuluru asked on 12 Mar 2014, 07:30 PM
Hello,

I have many radgrids in my solution & most of them have export to excel feature implemented. Recently, we added Summay & Caption Statements to these grids in the ASPX files. In order not to show the Captions when the grid is displayed, I added a CSS class like "rgCaption" or "MasterTable_Default caption" or "DetailTable_Default caption".

Here is the example of the class.

.rgCaption
{
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    visibility: hidden;
    line-height: 0;
}


So when the grid is displayed in the webpage, the caption is hidden. I also want to do something similar when I do the export to excel (using CSS). Currently all my exported excels show the Caption which I don't want. I can always say Grid.MasterTable.Caption = String.Empty() in OnExcelExportCellFormatting or OnGridExporting. But this approach would make me edit all of the pages where export is involved & is too tedious & time-taking. I also tried 

Any Ideas?

Thanks
Bobby

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 17 Mar 2014, 09:20 AM
Hello Bobby,

I am afraid that you could not use a CSS rule to hide the caption in the exported file. The only possible solution is to hide the caption by removing it before exporting to to excel.

Regards,
Kostadin
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
Grid
Asked by
Nagendra Thumuluru
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or