Posted 8 September 2017, 12:44 pm EST
I thought that the idea of having a Grouping/Grouped pair of events was that the Grouping event fires BEFORE the model is changed to the GroupDataModel and the Grouped event fires AFTER the change.
This assumption is reinforced by the fact that Grouping is cancelable, and the fact that the docs describe a number of features that are incompatible with the grouped model and tell me to use the Grouping event to take care of these.
As a result I added the following to the Grouping event:
1) Clear all filters
2) Clear Alternating row colors
3) Switch off automatic sorting
4) Remove the last line of the spreadsheet (This contains a 'totals' row)
The first 3 work fine (either that or the control does these things automatically and simply ignores my commands) but the last one fails.
The reason it fails is that the GroupDataModel is already in effect and the sheet.rows.count returns zero. (and I can not remove row -1)
Is the GroupDataModel supposed to be in effect when Grouping fires?
If so, what event fires BEFORE entering GroupDataModel?
(I checked Sheet_PropertyChanged [which does fire before Grouping], but even then the model had already been changed)
Also, if it is supposed to fire after the model change then the documentation needs to be changed to tell you to take care of the 'invalid' items in this other event - not in Grouping.
If it is firing incorrectly could that explain my problem with column numbers being displayed on the group rows instead of column names?