I have a bound datagridview with one of the properties in the bound list as PODate (nullable datetime).
In the DataGridView, it shows as “Tuesday, June 1, 2017”.
How do I get it to show as “6/1/2017”?
I have tried using the Format=Custom along with CustomFormat dd/MM/yyyy
I also tried changing the DefaultCellStyle.Format to “d”
Neither seems to work.
Thanks,
Shawn
Hi Shawn,
Have you tried the following?
var CellStyle = new DataGridViewCellStyle();
CellStyle.Format = “dd/MM/yyyy”;
myDateColumn.DefaultCellStyle = CellStyle;
Best,
Alex
Thank you, that worked.
Does this functionality not work thought the DGV designer UI in Visual Studio?
Please login first to submit.