DataGridView - Date only format

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!
1
0

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

  • You must to post comments
0
0

Thank you, that worked.

Does this functionality not work thought the DGV designer UI in Visual Studio?

  • Carl Daniel
    It appears that the designer drops the cell style on the floor for DateTimePicker columns – it’s missing from the .designer.cs file.
  • Frank (ITG)
    Hi Carl, thanks for your hint. We could reproduce and logged as WJ-8596. A fix will be included in the next Wisej build. Best regards, Frank
  • You must to post comments
0
0

Hi Shawn,

Have you tried the following?

var CellStyle = new DataGridViewCellStyle();
CellStyle.Format = “dd/MM/yyyy”;
myDateColumn.DefaultCellStyle = CellStyle;

Best,
Alex

  • You must to post comments
Showing 2 results
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Attachment
File Name Size
There are currently no files uploaded.
Maximum number of files 5, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json mixin.theme