Displaying dates and times in the DateTimeBase control
I need to edit a date in a separate form and precisely the dd / MM / YYYY part separated by the hh: mm: ss part
I therefore thought about using the DateTimeBase control.
the code I use is:
HorizontalAlignment = "Left"
VerticalAlignment = "Stretch"
Width = "100"
Grid.Column = "1"
Grid.Row = "2"
Text = "{Binding CurrentRecord.DataOper, Mode = TwoWay, UpdateSourceTrigger = PropertyChanged}"
">Pattern = "shortdate" />
for the part of the date I have to display dd / mm / yyyy
is
HorizontalAlignment = "Left"
VerticalAlignment = "Stretch"
Width = "100"
Grid.Column = "2"
Grid.Row = "2"
Pattern = "CustomPattern" CustomPattern = "hh: mm: ss"
">Text = "{Binding CurrentRecord.DataOper, Mode = TwoWay, UpdateSourceTrigger = PropertyChanged}">
Syf: DateTimeBase>
for the part of the date in which I have to edit the time in the format hh: mm: ss
the result unfortunately does not reflect how much I would like to get and is visible in the screenshot.
Can you tell me how to solve the problem?
Is the DateTimeBase control correct for this functionality?
Thank you
Moreno
I therefore thought about using the DateTimeBase control.
the code I use is:
VerticalAlignment = "Stretch"
Width = "100"
Grid.Column = "1"
Grid.Row = "2"
Text = "{Binding CurrentRecord.DataOper, Mode = TwoWay, UpdateSourceTrigger = PropertyChanged}"
">Pattern = "shortdate" />
for the part of the date I have to display dd / mm / yyyy
is
VerticalAlignment = "Stretch"
Width = "100"
Grid.Column = "2"
Grid.Row = "2"
Pattern = "CustomPattern" CustomPattern = "hh: mm: ss"
">Text = "{Binding CurrentRecord.DataOper, Mode = TwoWay, UpdateSourceTrigger = PropertyChanged}">
Syf: DateTimeBase>
for the part of the date in which I have to edit the time in the format hh: mm: ss
the result unfortunately does not reflect how much I would like to get and is visible in the screenshot.
Can you tell me how to solve the problem?
Is the DateTimeBase control correct for this functionality?
Thank you
Moreno
Attachment: 20180205_DataTimeBase_c7a2221e.zip
SIGN IN To post a reply.
4 Replies
MI
misonsan
February 5, 2018 04:28 PM UTC
Hi Keerthana J
thanks for your kind response
perhaps I think I have expressed myself incorrectly in the exposition of the problem.
I have a date to edit and I decided to use the "DateTimeBase" control.
It's correct ?
The date is view only without the possibility of making changes.
I would like to be able to display in a control the part of the date in dd / mm / yyyy format and in another check the part of the date in the format hh: mm: ss
Can I do this Using "DataTimeBase"?
Alternatively what control can I use?
The code I used is as follows:
<Syf: DateTimeBase
HorizontalAlignment = "Left"
VerticalAlignment = "Stretch"
Width = "100"
Grid.Column = "1"
Grid.Row = "2"
Text = "{Binding CurrentRecord.DataOper, Mode = TwoWay, UpdateSourceTrigger = PropertyChanged}"
Pattern = "shortdate" />
<Syf: DateTimeBase
HorizontalAlignment = "Left"
VerticalAlignment = "Stretch"
Width = "100"
Grid.Column = "2"
Grid.Row = "2"
Pattern = "CustomPattern" CustomPattern = "hh: mm: ss"
Text = "{Binding CurrentRecord.DataOper, Mode = TwoWay, UpdateSourceTrigger = PropertyChanged}">
</ Syf: DateTimeBase>
the result is visible in the attached screenshot.
If I can not use the "DateTimeBase" control, can you tell me how to edit the dates?
Thank you
Moreno
Attachment: 20180205_DataTimeBase_87e93160.zip
thanks for your kind response
perhaps I think I have expressed myself incorrectly in the exposition of the problem.
I have a date to edit and I decided to use the "DateTimeBase" control.
It's correct ?
The date is view only without the possibility of making changes.
I would like to be able to display in a control the part of the date in dd / mm / yyyy format and in another check the part of the date in the format hh: mm: ss
Can I do this Using "DataTimeBase"?
Alternatively what control can I use?
The code I used is as follows:
<Syf: DateTimeBase
HorizontalAlignment = "Left"
VerticalAlignment = "Stretch"
Width = "100"
Grid.Column = "1"
Grid.Row = "2"
Text = "{Binding CurrentRecord.DataOper, Mode = TwoWay, UpdateSourceTrigger = PropertyChanged}"
Pattern = "shortdate" />
<Syf: DateTimeBase
HorizontalAlignment = "Left"
VerticalAlignment = "Stretch"
Width = "100"
Grid.Column = "2"
Grid.Row = "2"
Pattern = "CustomPattern" CustomPattern = "hh: mm: ss"
Text = "{Binding CurrentRecord.DataOper, Mode = TwoWay, UpdateSourceTrigger = PropertyChanged}">
</ Syf: DateTimeBase>
the result is visible in the attached screenshot.
If I can not use the "DateTimeBase" control, can you tell me how to edit the dates?
Thank you
Moreno
Attachment: 20180205_DataTimeBase_87e93160.zip
KJ
Keerthana Jegannathan
Syncfusion Team
February 6, 2018 10:24 AM UTC
Hi Misonsan,
Thank you for contacting Syncfusion support.
We have maintained DateTimeBase control as base control for our DateTimeEdit control. In DateTimeBase control, you have made binding to the “Text” property which is from TextBox control from which control has been overridden. So, binding value has been taken as string which doesn’t considers the pattern used. So, we request you to use our DateTimeEdit control in which you can bind your values to “DateTime” property which gets set based on the pattern described by the user. We have prepared simple sample for your reference and it can be downloaded from the below location.
Sample: http://www.syncfusion.com/downloads/support/directtrac/198000/ze/WPFRibbon_basicSample-199997547
Also, we request you to refer the below link to know more about DateTimeEdit control
Regards,
Keerthana J
MI
misonsan
February 6, 2018 11:05 AM UTC
Thank you Keerthana for your kind reply and for the example.
I tried to download it, but it is not usable for some errors that I highlight attached.
If you are courteous to propose it again so that I can study it, I would be grateful.
Good day.
Moreno
Attachment: Errore_Ribbon_8ece54a4.zip
I tried to download it, but it is not usable for some errors that I highlight attached.
If you are courteous to propose it again so that I can study it, I would be grateful.
Good day.
Moreno
Attachment: Errore_Ribbon_8ece54a4.zip
KJ
Keerthana Jegannathan
Syncfusion Team
February 6, 2018 12:25 PM UTC
Hi Misonsan,
Sorry for the inconvenience caused.
Please find the sample from below location.
Regards,
Keerthana J
SIGN IN To post a reply.
- 4 Replies
- 2 Participants
-
MI misonsan
- Feb 5, 2018 10:39 AM UTC
- Feb 6, 2018 12:25 PM UTC