
Hi,
I've got a problem with the excel export for the RadGrid. My grid is a hierarchical grid, there's the master table, and 3 detail tables at the same level of hierarchy. When the user click to the command button for the excel export I need to suppress 1 column in 2 of 3 detail tables, in particular the column is an image column (in the exported file I see the image's pathname).
I try to set visible = false to this column in the RadGrid_ItemCommand, in the button click(i also tried to add a button for the excel export), in the
RadGrid_ItemCreated, but the exported file have only the MasterTableView. To obtain all the hierarchies in the exported file I have to leave unchanged the columns.
How can I suppress the column in detail tables, obtaining anyway all the hierarchies?
thanks in advance,
regards
MgfProject s.r.l
9 Answers, 1 is accepted

Try hiding the column as shown below.
C#:
RadGrid1.MasterTableView.DetailTables[0].GetColumn(
"UniqueName"
).Display=
false
;
-Shinu.

thanks for the answer.
the result is always the same, i can't obtain the detail tables in the excel file.
any other ideas?

Check the following demo which implements the same.
Grid / Export Hierarchical Grid
-Shinu.

I checked you demo, but that is not my case.
I can export all the data in the source of the grid, but if I try to hide a column, or I try to remove it, my excel result is without the hieararchies and it has only got the first level of the grid.
I want to obtain all the data but without 2 image columns in 2 of 3 hierarchies(that are at the same sublevel), and
I tried this in various ways but I couldn't.
here is an example image of my grid.
thank you in advance.
Have you tried persisting the expanded grid items or setting the HierarchyDefaultExpanded property of the corresponding table-views is set to true?
The Export Hierarchical Grid demo illustrated exactly these approaches.
If the issue persists, please provide more information on how the grid is exported and the column is hidden.
Greetings,
Mira
the Telerik team

as shown in the attached image , HierarchyDefaultExpanded is set to true.
My grid exports the file like in this example at this address http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/excelmlexport/defaultvb.aspx
In the event called ExcelMLExportRowCreated I set the style for the exported grid like number formats for cells and workbook properties. then in the ExcelMLExportStylesCreated event I try to hide the image column in the first in and the 2nd of 3 sub hierarchies.
thanks

any ideas??
thanks in advance
Please use the approach from the last section of the ExcelML basics help topic to hide the columns.
I hope it helps.
Regards,
Mira
the Telerik team

that KB was helpful.
regards