Using the grid with OnRead event to fill data. I need to set the sortings at runtime, so I use also the OnStateInit event.
It all works fine because OnStateInit fires before OnRead and I set the sorting inside OnStateInit.
If I put an empty GridAggregates then OnStateInit fires after OnRead thus inside OnRead I don't have the sortings set.
===
ADMIN EDIT
===
As a workaround for the time being, do not include empty GridAggregates tag, only add them when you actually want to include some aggregate functions.