0

Is it possible to have an editable DatagridTextColumn that only displays the Time portion of the Datetime but returns the full Datetime?

I have tried with StringFormat, but after editing the time portion of the DateTime it will return the current date and not the original date.

 People.Add(new Person() {Name = "Jack", StartTime = new System.DateTime(2020, 01, 29, 13, 10, 00) });

<DataGridTextColumn Header="Start Time" Binding="{Binding StartTime, StringFormat=hh\\:mm\\:ss}" />

The above StringFormat will return the current date with an edited time and not the original date of 29.01.2020

I am guessing that StringFormat is not the right thing to use, but I am at a loss what else I can use.

GanSea
  • 21
  • 3
  • See [this](https://stackoverflow.com/questions/41955922/binding-date-only-and-time-only). – mm8 Apr 24 '20 at 12:00
  • `StringFormat=hh:mm:ss` do like this. Also it looks fine. you are assigning the full date but showing the Time part of that date. which mean it should return same date. – Hammas Apr 24 '20 at 12:00

0 Answers0