We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Date/Time in DataGrid

I have a simple question. When I bind my datagrid to the data table containing "time" fields with date/time datatype, it only gives me the date. I don't want the date because there are no dates in my database. The time is not appearing!

1 Reply

CB Clay Burch Syncfusion Team June 20, 2002 03:53 AM

If you have added a tablestyle to your datagrid, then you can access the columns's columnstyle in the columnstyle collection member of the tablestyle, and set its Format property. The FAQ referenced below shows how you might do this. You would change the format string to somethiing like "mm:ss t". George Shepherd's Windows Forms FAQ contains an entry entitled: How do I format a date column in a datagrid? Check it out at: http://www.syncfusion.com/faq/winforms/search/867.asp

Loader.
Live Chat Icon For mobile
Up arrow icon