I understand that the data beneath the columns will be sorte

The only issue which can cause such problem - non unique row IDs, please be sure that each row has unique ID (row@id attribute in case of loading from XML )

If issue still occurs for you - please provide any kind of sample where problem can be reconstructed.