ใส่ Format วันที่-เวลา ให้กับ Cell ของ DataGrid

private void dgvShow_CellFormatting(object sender, taGridViewCellFormattingEventArgs e)
{
if (dgvShow.Columns[e.ColumnIndex].Name == "dtInDate")
{
e.CellStyle.Format = "dd/MM/yyyy HH:mm:ss";
e.CellStyle.Alignment =
DataGridViewContentAlignment.MiddleLeft;
FormatdgvShow();


}
if (dgvShow.Columns[e.ColumnIndex].Name == "dtOutDate")

{
e.CellStyle.Format = "dd/MM/yyyy HH:mm:ss";
e.CellStyle.Alignment =
DataGridViewContentAlignment.MiddleLeft;
FormatdgvShow();


}

}

ความคิดเห็น

โพสต์ยอดนิยมจากบล็อกนี้