hi,
how can I format a date/time column held in a DataTable. I want to display only the time part of it.
Printable View
hi,
how can I format a date/time column held in a DataTable. I want to display only the time part of it.
You don't. A DataTable should store DateTime values and they have no format. Format is only an issue when converting a DateTime value to a String, which 99 times out of 100 would be done in order to display it. If that is what you want to do then how you format the string depends on how it's being displayed.
well actually I could not find a way to format the date/time column of my database table in the datagrid in my compact framework app. so I thought might as well try to format it in the datatable itself before binding it to the data grid. ya i understand its not right.
well i guess i'll have find an alternative.
any ideas???
I'm not sure how much the CF supports but column formatting in a DataGrid is usually handled by the DataGridColumnStyle class. Check out this page for heaps of DataGrid information.
OK thanks.....:wave: