DataGrid Sorting

Terence Heaford t.heaford at btinternet.com
Wed Jul 23 03:16:16 EDT 2014


Hi,

I have a table with 6 columns.

Column 1 is a date column formatted as UK english dd/mm/yyyy

I want my sorted column to be

01/02/2011…
01/02/2011…
01/02/2011…
01/02/2011…
01/02/2012…
01/02/2012…
01/02/2012…
01/02/2012…
01/02/2013…
01/02/2013…
01/02/2013…
01/02/2013…

but using this code snippet

on SortDataGridColumn pColumn

switch pColumn
   case "date"
 
      SortDataByKey "date","dateTme", "Ascending", false

--pass SortDataGridColumn
break

case “column2"
--pass SortDataGridColumn
break

case “column3"
--pass SortDataGridColumn
break

case “column4"
--pass SortDataGridColumn
break

case “column5"
--pass SortDataGridColumn
break

case “column6"
--pass SortDataGridColumn
break

default
--pass SortDataGridColumn
end switch
end SortDataGridColumn


I get

01/02/2012…
01/02/2012…
01/02/2012…
01/02/2012…
01/02/2013…
01/02/2013…
01/02/2013…
01/02/2013…
01/02/2011…
01/02/2011…
01/02/2011…
01/02/2011…

I must be doing something wrong, I have tried "set the useSystemDate to true" but that has not worked or does DataGrid only work with US dates.

Can someone help please?

Thanks

Terry






More information about the use-livecode mailing list