DateTime Display in Windows Form application
I have a windows form application. I have a query which return me datetime in the format dd-MM-yyyy.
But when this datetime is displayed in a datagrid it is displayed as dd/MM/yyyy
.
I wish to display dd开发者_开发知识库-MM-yyyy
in my datagrid. How can this be achieved.
You set this in the column's DefaultCellStyle.Format:
this.dataGridView1.Columns["Date"].DefaultCellStyle.Format = "dd-MM-yyyy";
精彩评论