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

no time for DateTime type in Databroudgrid

Hi, I used databoundgrid with dataset as data source. After I query the database and load the data, it seems the grid will put DateTime type data in a DateTimePicker. And I can only see date(as 5/20/04). Is there any way for me to see the time only( or at least Date with time)? I had a look on the samples and tried to define the col type as DateTime, but it did not work out. Thanks a lot Chris

1 Reply

AD Administrator Syncfusion Team May 21, 2004 12:51 PM UTC

By default, the GridDataBoundGrid places a MonthCalendar cell control if you column has datatype of DateTime. And, this control does not allow you to set the time. But you can see the time by providing the proper GridBoundColumn.StyleInfo.Format property that includes the time. This sample shows this formatting and hides the button so the user cannot drop the calendar and kill the time. Forum_DateTime_3465.zip If you want to use a DateImePicker in the cell (instead of the deafult MonthCalendar), here is a KB article that contains a custom cell type that does this. http://www.syncfusion.com/Support/article.aspx?id=10435

Loader.
Live Chat Icon For mobile
Up arrow icon