Home Forums WinForms controls Xceed Grid for WinForms Data / Time question problem Reply To: Data / Time question problem

User (Old forums)
Member
Post count: 23064

You have to set the <b>FormatProvider</b> and <b>FormatSpecifier</b> properties of the column, like this:<code>grid.Columns[“dt”].FormatProvider = CultureInfo.CurrentCulture.DateTimeFormat;
grid.Columns[“dt”].FormatSpecifier = “format string”;</code>
The format string defines how the date & time is formatted:
– date: “dd-MM-yyyy” (month = uppercase M)
– time: “HH:mm:ss” (hour: uppercase H = 24 hour clock)
– both: “dd-MM-yyyy HH:mm:ss”

Imported from legacy forums. Posted by Tommy (had 469 views)