User (Old forums)MemberJanuary 30, 2005 at 5:49 amPost count: 23064
I have an Access Data Base which have a “Date/Time” type field. The problem is, whatever format I put in this field (short date, long data/time, only date, only time) Xceed grid will always displays me the following format…
I how can I format date and time in Xceed Grid?
Please use some code to explain this (if possible)
I will really appreciate your help on this one…
Imported from legacy forums. Posted by EFileTahi-A (had 1178 views)User (Old forums)MemberJanuary 31, 2005 at 2:37 amPost count: 23064
In what format do you want it to be?
Imported from legacy forums. Posted by Tommy (had 232 views)User (Old forums)MemberJanuary 31, 2005 at 5:13 amPost count: 23064
For date I will need the “dd-mm-yyyy” format, as for time, I need hh:mm:ss (24 hour clock)…
Hope to hear from you soon…
Imported from legacy forums. Posted by EFileTahi-A (had 322 views)User (Old forums)MemberJanuary 31, 2005 at 6:33 amPost 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)User (Old forums)MemberFebruary 1, 2005 at 7:07 amPost count: 23064
Thank you Tommy!
Imported from legacy forums. Posted by EFileTahi-A (had 3535 views)User (Old forums)MemberApril 23, 2008 at 9:28 pmPost count: 23064
Are the “FormatProvider” and “FormatSpecifier” properties obsolete ? I can not find those properties in the Column class.
How can I still setting the Format to the current user CultureInfo ?
Imported from legacy forums. Posted by Harold (had 640 views)Xceed SupportMemberApril 24, 2008 at 4:15 pmPost count: 5658
No, these properties are not obsolete. You should be able to set those properties.
What exactly is the DataType of your column? Our DateEditor only supports the DateTime type, not the SQLDateTime. If your DataType is SQLDateTime, you will need to use your own Editor, our convert the data to DateTime type.
Imported from legacy forums. Posted by CharlesB (had 1200 views)
- You must be logged in to reply to this topic.