DataGrid Table Column Reordering
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
DataGrid Table Column Reordering
Hello,
I just completed a DataGrid Table, and noticed that by default, you can click the column headers and reorganize the data by alphabetical (or reverse-alphabetical) order. I placed the order in the dgData in a specific order, and do not want it to be sorted any other way.
Two questions:
1. How can I correct the DG to NOT sort the information I have in it, so that when I refresh it, the data displays as it should according to my loading handler? (I have scripted a bunch of the column behaviors, so I am hoping I don't have to totally delete this DG and make a new one)
2. How can I make it so clicking the column header does nothing, instead of sorting the dgData?
Thank you in advance for any help on this... hope you are having a wonderful winter so far!
Phil E.
I just completed a DataGrid Table, and noticed that by default, you can click the column headers and reorganize the data by alphabetical (or reverse-alphabetical) order. I placed the order in the dgData in a specific order, and do not want it to be sorted any other way.
Two questions:
1. How can I correct the DG to NOT sort the information I have in it, so that when I refresh it, the data displays as it should according to my loading handler? (I have scripted a bunch of the column behaviors, so I am hoping I don't have to totally delete this DG and make a new one)
2. How can I make it so clicking the column header does nothing, instead of sorting the dgData?
Thank you in advance for any help on this... hope you are having a wonderful winter so far!
Phil E.
Re: DataGrid Table Column Reordering
Hi Phil,
OK since no one else has answered this yet I'll give you a workaround...
Export snapshot of the DG, do a little cropping to get only the header then import the image and place it over the top of the DG.
This only works if the DG is non-resizable.
Simon
OK since no one else has answered this yet I'll give you a workaround...
Export snapshot of the DG, do a little cropping to get only the header then import the image and place it over the top of the DG.

This only works if the DG is non-resizable.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: DataGrid Table Column Reordering
The easiest way :
in the DG script, put :
That's all.

in the DG script, put :
Code: Select all
on SortDataGridColumn pColumn
--pass SortDataGridColumn
end SortDataGridColumn

Re: DataGrid Table Column Reordering
Code: Select all
on SortDataGridColumn pColumn
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: DataGrid Table Column Reordering
Simon,
Very creative first solution! I should think like that more...
Bangkok,
I think I will go with you on that one! That's exactly what I needed.
Thank you both!
Phil E.
Very creative first solution! I should think like that more...
Bangkok,
I think I will go with you on that one! That's exactly what I needed.
Thank you both!
Phil E.
Re: DataGrid Table Column Reordering
To help anyone else who is having similar issues, I realized that this topic is covered in the Tutorials in the Developer section of LiveCode.com, so I thought I would post the link to make the background information available, also.
http://lessons.runrev.com/s/lessons/m/d ... mn-sorting
Cheers!
Phil E.
http://lessons.runrev.com/s/lessons/m/d ... mn-sorting
Cheers!
Phil E.