Page 1 of 1
datagrid column order
Posted: Mon Dec 21, 2015 2:05 pm
by bsouthuk
Hi
Is it possible to change the order of the columns in a datagrid with a couple of lines of code or would it be a case of a loop formula and then setting the dgText of datagrid to ****
Cheers
Daniel
Re: datagrid column order
Posted: Mon Dec 21, 2015 2:25 pm
by Klaus
Hi Daniel,
sorry, no idea, but you could try to -> set the dgprops["columns"] of grp "your datagrid here" to XXX
to the new ordered list of column names and see what happens
Best
Klaus
Re: datagrid column order
Posted: Mon Dec 21, 2015 2:38 pm
by bsouthuk
Thank you Klaus, I have tried
Code: Select all
set the dgprops["columns"] of grp "Usage" to "TARIFF", "NETWORK", "MOBILE"
But this doesn't seem all the text just goes into the one column. I am having trouble separating them!
Any ideas?
Re: datagrid column order
Posted: Mon Dec 21, 2015 2:41 pm
by bsouthuk
ITS OK I FORGET THE.. replace comma with return in *****
Re: datagrid column order
Posted: Mon Dec 21, 2015 2:44 pm
by bsouthuk
OK so the issue I now have here is that the data that was stored in the Datagrid all disappears accept the first column...
Why on earth does this happen?
Re: datagrid column order
Posted: Mon Dec 21, 2015 2:49 pm
by Klaus
Obviously this is not the way to go...
But you tried this with a copy of your data, right?

Re: datagrid column order
Posted: Mon Dec 21, 2015 2:51 pm
by bsouthuk
Hi Klaus
I did yes, my datagrid was full of data, I used the following code:
Code: Select all
put "CALL DATE, TARIFF, NETWORK" into tColumnTitles
replace comma with return in tColumnTitles
set the dgprops["columns"] of grp "Usage" to tColumnTitles
The column names changed correctly, but the only data within the Datagrid that remained for the first columns data.
Re: datagrid column order
Posted: Mon Dec 21, 2015 2:57 pm
by Klaus
As I said, this obviously does not work as exspected.
But make sure to remove unwanted spaces:
...
## put "CALL DATE, TARIFF, NETWORK" into tColumnTitles
put "CALL DATE,TARIFF,NETWORK" into tColumnTitles
...
See the difference? They might go into the new column names!
Not that this helps you with your problem.
Re: datagrid column order
Posted: Mon Dec 21, 2015 3:02 pm
by bsouthuk
SORTED! Works perfectly, thank you for you help Klaus its very much appreciated.
Re: datagrid column order
Posted: Mon Dec 21, 2015 3:09 pm
by Klaus
So it DOES in fact work as exspected with the correct column names?
Cool!

Re: datagrid column order
Posted: Tue Dec 22, 2015 4:53 am
by quailcreek
I got caught up in something similar awhile ago. Just for reference, here's another way of stating the same thing.
Code: Select all
put ("CALL DATE", "TARIFF", "NETWORK") into tColumnTitle