AdvColumnGrid Sorting Issue


One of the columns in my AdvColumnGrid I load as a date as text (eg. 08/15/1012).  The SortStyle is set to ssAutomatic.  The Editor is set to edNormal.

For my users who have their Windows date format set to mm/dd/yyyy the sort works as expected.  However for my users who have their Windows date format to be to be  dd/mm/yyyy the sort no longer works.

Have tried different SortStyles without success.

Any help would be appreciated.

Thank you,


For the ssAutomatic sorting to work, the displayed date should always be in the same format as the system format.

If you have a date displayed in a fixed format on machines that can have different format, you would have to handle this via custom sorting, i.e. do the date comparison yourself on application level code for the specific day format you use for the grid.

Thank you Bruno.

Any idea on what function I call to get the date format in use by Windows? 


The default setting of the Delphi global variable ShortDateFormat should be initialized to the Windows date format, so you can read it via this variable.