Hello,
we are using a UltraGridExcelExporter component to export a grid to an excel worksheet. It works quite fine, but if we need to export a large number of rows it takes its time. Now we want to implement a simple logic to export only selected rows of the grid, so we used the rowexporting event. This should also work fine to skip the non selected rows of the grid.
But what should we do, if the user wants to cancel the complete exporting? I suppose, we could use the EndExportEventArgs.Cancelled property to know when it was cancelled, but how do i set this property?
Greetings
You can cancel the exporting during the InitializeRow event of the UltraGridExcelExporter. There are properties on the event args to allow you to skip child rows, skip individual rows, and cancel. So this is probably a better place to hide the non-selected rows, too.
Hello Mike,
your answer helped me a lot ;-) thanks.
But i need a quick suggestion on how to find out which parent rows are to be exported, when a child row of a parent row is selected. This is because for every parent row and every child row the InitializeRow event is fired.
If a ParentRow is selected i want to export all Childrows
if a single childrow is selected i want to export the parentrow and all childrows of that parent.
We counted the number of selected parentrows and for each of these parentrows we counted the number of childrows. that gets us a number at appr. 1000
but if InitializeRow is fired none of the childrows get exported because their parentrow isnt selected either (even if we selected all parent rows in the grid).