Excel export of Telerik Kendo Grid with multiple detail levels

╄→尐↘猪︶ㄣ 提交于 2019-12-11 02:17:48

问题


I have a Kendo Grid with "multiple hierarchy" - two detail levels, like this:

  • Main row
    • Details
      • Details of details
      • Some more details of details
    • Details
      • Details of details
  • Main row
    • Details
      • Detail of details

Using this example I am able to export the "Main row" along with the "Details" row. But I am having a hard time exporting the "Details of details" row. I know it is possible using the approach in the example, but cannot seem to shuffle the code "the right way". Has anyone done this before, and can provide an example?

Thanks.


回答1:


for anyone who is still looking for an answer to this, I was able to do an implementation of a 3-level export. It doesn't look the most pretty thing in the world but feel free to contribute and make it better. You can see the full implementation in this link. I also solved an issue where the export wouldn't work correctly for multiple exports.

Basically, you need to recalculate the master row indexes of each export every time you click expand in the master grid as the master row indexes are recalculated by Kendo. E.g. you expand row 4 (which will display a grid with 6 rows), then you expand row 1 (which will display a grid with 12 rows). When you do this, the index of "row 4" is updated with 4 + 12. So the new index of "row 4" is actually 16. You also need to be aware of header/footer rows if you want to export them or not.



来源:https://stackoverflow.com/questions/34840075/excel-export-of-telerik-kendo-grid-with-multiple-detail-levels

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!