datagrid column order
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
datagrid column order
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
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
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
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
Thank you Klaus, I have tried
But this doesn't seem all the text just goes into the one column. I am having trouble separating them!
Any ideas?
Code: Select all
set the dgprops["columns"] of grp "Usage" to "TARIFF", "NETWORK", "MOBILE"
Any ideas?
Re: datagrid column order
ITS OK I FORGET THE.. replace comma with return in *****
Re: datagrid column order
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?
Why on earth does this happen?
Re: datagrid column order
Obviously this is not the way to go...
But you tried this with a copy of your data, right?

But you tried this with a copy of your data, right?

Re: datagrid column order
Hi Klaus
I did yes, my datagrid was full of data, I used the following code:
The column names changed correctly, but the only data within the Datagrid that remained for the first columns data.
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
Re: datagrid column order
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.
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
SORTED! Works perfectly, thank you for you help Klaus its very much appreciated.
Re: datagrid column order
So it DOES in fact work as exspected with the correct column names?
Cool!
Cool!

-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
Re: datagrid column order
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
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14