Hi Terry, No need of the SortDataGridColumn handler in this case. Sorting type can be handled by using the dgColumnSortType property of the datagrid:
set the dgColumnSortType["date"] of grp "myDatagrid" to "system dateTime" Best Regards, On Wed, Jul 23, 2014 at 9:16 AM, Terence Heaford <t.heaf...@btinternet.com> wrote: > 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 > > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode -- Zryip TheSlug http://www.aslugontheroad.com _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode