Current filter:
                                You should refresh the page.
                                  • Hi

                                    I am using your grid control to show database query results

                                    The date times are stored in my SQLite database in W3C / ISO 8601 format e.g.


                                    and I have one of my columns set up as below as I want to see date on screen as dd/MM/yyyy HH:mm:ss

                                    Dim gcArchive1 As GridColumn = GridView_Archive.Columns.AddField("TimeCreated") gcArchive1.Caption = "Time Created" gcArchive1.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime gcArchive1.DisplayFormat.FormatString = "dd/MM/yyyy HH:mm:ss"

                                    But it doesn't seem to work as grid shows


                                    when I want

                                    28/07/2017 23:39:20


                                1 Solution

                                Creation Date Importance Sort by

                                Hi Darren,

                                To achieve the desired value formatting, create RepositoryItemDateEdit, assign it to your gcARchive1 column, and adjust its settings as follows:

                                Dim de As New RepositoryItemDateEdit() de.Mask.EditMask = "dd/MM/yyyy HH:mm:ss" de.Mask.UseMaskAsDisplayFormat = True gcArchive1.ColumnEdit = de

                                This way, everything should work as expected. Please try this approach and let me know if it works for you.

                                • Darren Rose 09.14.2017

                                  Thank you Pavel - that works really well for me

                                  I do have one additional question relating to this

                                  As per this support question (link below) I am using DataLayoutControl to show values from the grid control in fields below - so now I have date showing correctly in grid, I also need to show it correctly in the DataLayoutControl - can that be done

                                  I will also ask this question on that post as might be easier for Andrew Ser to answer as he has been working on it with me


                                • Pavel (DevExpress Support) 09.14.2017


                                  Yes, it is possible. You can achieve that using the DataLayoutControl's FieldRetrieving and FieldRetrieved events. In the FieldRetrieving event, assign the DateEdit editor to your TimeCreated layout item. Use the FieldRetrieved event to adjust the corresponding repository item settings as we did it with the GridControl. Please review the mentioned documentation articles to find an example of how to use these events. Should you have any further questions, please let me know.

                                • Darren Rose 09.16.2017

                                  Hi again Pavel

                                  I have one problem with you original solution - in that it changing the time when it changes the format

                                  e.g. if field contains  2017-09-15T19:29:23.700Z

                                  then edit mask is then showing it as 15/09/2017 20:29:23

                                  i.e. adding 1 hour to the time?

                                  How can I fix this?

                                • Pavel (DevExpress Support) 09.18.2017

                                  Hi Darren,

                                  I believe that the cause of this behavior is that your local time zone differs from the UTC time by one hour. The "Z" modifier at the end of your date-time string indicates that the time is stored in UTC. Converting it to a local format adds 1 hour to the time. I hope this information will be helpful.