Here are the steps needed to recreate the problem. To see the problem, it’s important that you do not do any sorting or grouping while viewing the records beyond what is stated here; otherwise the behavior may be different.
1. Create a normal form along with a view. Add both a Number field and a Single Line field to the form using the default settings.
2. Access the application and enter the following records in the order shown:
1, dog
2, brown
1, cat
2, black
1, bird
2, white
3. Go to the View and verify all six records are shown. Notice the order shows the last record is listed first, and the first record is listed last. This is expected.
4. Click on the “Edit this application” to edit the View. Click on “Set Sorting” and sort on the Single Line field, then click the Done button.
5. Access the application and look at the View. Notice, the records are not sorted. Do NOT sort (or group) the records while viewing the records. Doing so will affect the behavior.
6. Now go back and edit the View again. This time click on “Set Grouping” and group by the Number field, then click the Done button.
7. Access the application again, and look at the View. Notice again, the records are not grouped (or sorted).
8. This time, while viewing the records, group on the Number field. Notice, the records are grouped.
9. Go back and edit the View again. Click on “Set Grouping” and remove the Number field, then click the Done button.
10. Access the application again. Notice, the records are still grouped (and sorted).
11. Click on the link in the Menu to refresh the View. Notice that each time you click on the link and refresh the View, the records are sometimes grouped or sometimes not grouped. (This may require clicking 5 or more times.) The behavior is erratic and unpredictable. I also found that if you remove the sorting (along with the grouping) in edit mode, the records remain grouped.
Group Ascending or Descending.
In addition to this problem, I also noticed that when records are grouped, they must be either ascending or descending. There is no choice to allow grouping without sorting. In many cases, it is desirable that the field be grouped using the current order or last sort. The user or developer should be allowed to choose whether to group and sort, or only group. In general, forcing the group always be ascending or descending is inflexible and not always desirable.