DataGrid EditModeReorderCompleted how to
Posted: Fri May 21, 2021 12:25 pm
I am trying to figure out how to decipher the datagrid data after reordering of items using the message EditModeReorderCompleted. I have a very simple DataGrid (form) with a single item "Label" in a row. The data is just the letters a, b, c, d, e and f. I've got the reordering working no problem there and am able to receive the message (ps. on EditModeReorderCompleted needs to be in the DataGrid script not the row template script).
My goal is to end up with an array that represents the re-ordered list after a drag-reorder.
When I drag-reorder the rows and then look at the dgData of the datagrid, the elements of the dgData array are the original order of the letters, not the re-ordered order of the letters. So, as an example, if I move 'a' to row 3 on the screen, the dgData still shows 'a' at position 1 of the array.
The dgText of the datagrid returns the newly ordered list correctly. I see the message has 3 parameters. I presume there is some way to use the parameters to get what I'm looking for. Of course I could also turn the dgText into the array I need (but that feels dirty).
Can anyone help me with a clean way to get the re-ordered rows into an array? How do I get dgData to have the reordered list of elements? Is using the dgText the best way to do it?
Thanks in advance,
Bob H.
My goal is to end up with an array that represents the re-ordered list after a drag-reorder.
When I drag-reorder the rows and then look at the dgData of the datagrid, the elements of the dgData array are the original order of the letters, not the re-ordered order of the letters. So, as an example, if I move 'a' to row 3 on the screen, the dgData still shows 'a' at position 1 of the array.
The dgText of the datagrid returns the newly ordered list correctly. I see the message has 3 parameters. I presume there is some way to use the parameters to get what I'm looking for. Of course I could also turn the dgText into the array I need (but that feels dirty).
Can anyone help me with a clean way to get the re-ordered rows into an array? How do I get dgData to have the reordered list of elements? Is using the dgText the best way to do it?
Thanks in advance,
Bob H.