private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.ColumnIndex == dataGridView1.Columns["StartTime"].Index || e.ColumnIndex == dataGridView1.Columns["EndTime"].Index) { if (dpString.dTrim(e.Value) != "") { e.Value = Convert.ToDateTime(e.Value).ToString("MM/dd/yyyy - HH:mm:ss"); } } }