Saving datagrid data and placing it back
Posted: Thu Jul 13, 2017 7:55 pm
In my application I fill a datagrid (DG) with a collection of numbers
What I want to do it to save this collection including the order into an Array, empty the DG and fill the DG with a new collection.
Later I want to place a saved collection back into this DG and in the same order as I saved it.
I thought that would be straight forward by doing it the following way but this does not work?
First save the DG data into an array named ArrayCollection1:
And when I need to put the data in ArrayCollection1 back into the datagrid i do:
However this does not work
What am I doing wrong and how to achieve this as easy as possible?
What I want to do it to save this collection including the order into an Array, empty the DG and fill the DG with a new collection.
Later I want to place a saved collection back into this DG and in the same order as I saved it.
I thought that would be straight forward by doing it the following way but this does not work?
First save the DG data into an array named ArrayCollection1:
Code: Select all
put the dgData of group "NumbersCollection" into ArrayCollection1
Code: Select all
put ArrayCollection1 into theDataA
put 1 into theLineNo
dispatch "AddData" to group "NumbersCollection" with theDataA, theLineNo
put the result into theNewIndex -- integer if successful, error string otherwise
set the dgVScroll of group "NumbersCollection" to theLineNo

What am I doing wrong and how to achieve this as easy as possible?