Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
Show date or date time in one column
posted

Hi,

I have a column of which the UnderlyingSystemType is Datetime. However, the data I feed into the column need to be displayed in two format. For instance: date only for 2011-08-19 00:00:00.000; Datetime for 2018-08-03 17:52:37.000

Since my data is huge, I don't think the performance will be good if using the InitializeRow event of the grid. Please let me know how to achieve the goal using other tools. Thank you!

Parents
No Data
Reply
  • 12480
    Offline posted

    Hi Yunhan,

    You can accomplish this by using a custom FormatProvider. We've put together a sample that demonstrates how you might do this.

    Note that it is somewhat unusual to do this, as 00:00:00.000 is midnight and that might be a valid time.

    WinGrid_TimeFormatter.zip

Children
No Data