How to Change Format column in Datagridview to date type for this value

你离开我真会死。 提交于 2019-12-07 04:11:40

问题


For example, I have a value like this :

41607.2069444444; 41607.2068402778; 41607.2072222222;

this is calculation of dateTimeOrigination from CDR, in excel where i change the format cell to type date, its work and this is 11/29/2013 4:58:42 AM. My questions is how to format this value to date in datagridview in VB.net?


回答1:


Try like this:

MyDatagridview.Columns(4).DefaultCellStyle.Format = "dd.MM.yyyy HH:mm:ss"

In my case the 5th column (Remember that Datagridview.Columns are zero-based) is Date-Type Let me know if it helped you :)



来源:https://stackoverflow.com/questions/21749542/how-to-change-format-column-in-datagridview-to-date-type-for-this-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!