I would suggest you to disable sorting in the datagrid (uncheck Sortable for that column), and sort the list while retrieving from db in the microflow (ORDER BY RowID ASC).
This way datagrid will always show the list sorted by RowID
To dynamically change the RowID of selected Rows and refresh on the screen, place a parent dataview object with a boolean Refresh attribute.
Whenever user click the button, you microflow can change the RowIDs of the related rows and commit them (without refresh) and at the last step of the microflow just toggle the Parent object's Refresh attribute. this way, datagrid will refresh itself automatically and you will have the list with new RowIDs as you wished.
Hi Shahbaz and Sujata,
Out of curiosity, I tried to replicate this scenario. If I understood correctly, you want to move rows up/down with an inline button.
In that case, you just need to swap the RowID values of the selected row and the impacted up/down row, commit both objects, and refresh them.
Then in Data Grid 2, make sure the datasource is sorted by RowID ASC.
That's all :)
for your reference what i did was - to use one microflow for up/down sequence - I sent selected rowId - 1 in case of moving up, selected rowId + 1 in case of moving down. then in microflow retrieve the NewRowID object and swapted the rowIds.
At datagrid 2 :
Hope this helps !!
lemme know if i missed anything