DataGridView显示日期格式问题

给DataGridView单元格绑定或者赋值DataTime数据后有时会发现不能显示完整的数据格式,怎么办呢?
给出解决方案如下:

1.指定整列的显示格式:
m_dataGridView.Columns[columnIndex].DefaultCellStyle.Format = "yyyy-MM-dd hh:mm:ss";

2.指定某个单元格的显示格式:
DataGridViewCell cell = m_dataGridView[columnIndex, rowIndex];
DataGridViewCellStyle cellStyle = new DataGridViewCellStyle(cell.Style);
cellStyle.Format = "yyyy-MM-dd hh:mm:ss";
cell.Style = cellStyle;

原文地址:https://www.cnblogs.com/mohanchen/p/7049836.html