Replied 8 September 2017, 3:20 pm EST
This is the intended behaviour.
The model index is always used for calculations, so when the rows are sorted, the formulas will use the model index.
Hence, you can set the row header labels to make it clear which cells reference which cells:
// add code to set row header labels
for (int r = 0; r < 50; r++)
m_SheetView.SetRowLabel(r, 0, m_SheetView.GetRowLabel(r, 0));
That will make the row header labels sort with the rows, so it's clear which rows are referenced in the formulas after sorting.
Hope it helps.