I have a grid and at runtime I set the DataSource property to a DataTable.
When it binds, if the table has a DateTime column in it, it only shows the date. How can I get it to display the hours, minutes, seconds, milliseconds?
Thanks
UltraGridColumn exposes a Format property, which accepts any .NET date/time format specifier, for example, you could set it to "g", the token for the general date format. You can do this in response to the InitializeLayout event, by accessing the column from the e.Layout.Bands[n].Columns collection.
Note that if you want to enable editing of the time components, you also need to set the MaskInput property, although that property does not recognize exactly the same specifiers. You can do something like this to get a basic date/time mask:
EditorWithMask editor = column.Editor as EditorWithMask;string mask = editor.CalcDefaultDateMask(null, true) + " " + editor.CalcDefaultTimeMask(null);
Hi Jonathan,
You can set the columns Format property to something like “yyyy-MM-dd HH:mm:ss.fff” in the InitializeLayout event. I believe and the following forum post will be helpful for you: http://forums.infragistics.com/forums/p/34965/210095.aspx#210095
Let me know if you have any further questions.
Best Regards,
Stefaniya