csla smart date display issue in devexpress grid

csla smart date display issue in devexpress grid

Old forum URL: forums.lhotka.net/forums/t/9658.aspx

Paul Coetser posted on Tuesday, October 19, 2010

Hi There, 


I have a problem with the display format of the smartdate within a devexpress grid.

Please look at the attachedment, and within the archive there is a screendump folder.


What you will not is I have a normal datatable with a normal datetime column.  it display the date correctly within the grid.  when you click within the date column it still keeps the correct date format of dd/mm/yyyy (that is my regional settings)


I have another datatable with a smart date column (instead of datetime)  and what you will note is when the data is displayed in the grid, it displayed correctly as dd/mm/yyyy.  but when you click within the date column it swap the dd and mm around and then try to do a parse of that date.  if the day > 12 then it becomes the month and it cannot parse that date and it will clear the active editors text.  if the day is <= 12 it will swap the dd and mm around in the active editors text.

Now this behaviour does not happen with normal datetime.


So I'am not 100% sure where the problem is, but i tend to think it is within the smartdate class..



Paul Coetser

RockfordLhotka replied on Thursday, October 21, 2010

SmartDate is designed to solve a specific problem where the property type is string, and the backing field needs to be a date that can treat an empty string as an empty (not null) date.

If you are exposing a SmartDate directly as the property type, then what are you hoping to gain that you don't get from DateTime itself?

Copyright (c) Marimer LLC