Hello, Paul,
I would like to follow up on this case. If you want, you can use the following workaround until the feature request is introduced.
private void radButton1_Click(object sender, EventArgs e)
{
GridViewSpreadExport export = new GridViewSpreadExport(this.radGridView1);
export.ExportChildRowsGrouped = true;
export.ExportVisualSettings = true;
export.ExportHierarchy = true;
var renderer = new SpreadExportRenderer();
renderer.WorkbookCreated += this.Renderer_WorkbookCreated;
export.RunExport(@"..\..\Exported\spreadsheet" + DateTime.Now.ToString("HH-mm-ss"), renderer);
}
private void Renderer_WorkbookCreated(object sender, WorkbookCreatedEventArgs e)
{
var worksheet = e.Workbook.Worksheets[0];
CellRange usedCellRange = worksheet.UsedCellRange;
for (int rowIndex = usedCellRange.FromIndex.RowIndex; rowIndex <= usedCellRange.ToIndex.RowIndex; rowIndex++)
{
RangePropertyValue<int> outlineLevelRangeValue = worksheet.Rows[rowIndex].GetOutlineLevel();
int outLineLevel = outlineLevelRangeValue.Value;
if (outLineLevel > 0)
{
RowSelection rowSelection = worksheet.Rows[rowIndex];
rowSelection.SetHidden(true);
}
}
}
As result the grid is exported with collapsed rows:
I hope this helps. Should you have other questions do not hesitate to contact us.
Regards,
Nadya | Tech Support Engineer
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
I have also updated your Telerik points.