Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
745
XamDateTimeEditor
posted

I would like to use the XamDateTimeEditor, but use a text box to allow input of a date in numerous formats for usability purposes.

From what I have tried so far it doesn't seem like this is going to be quick and easy.  Could someone please provide me with some direction on where to start?

I can't give a null mask, should I go through the work of overriding the EditTemplate?

 

Thanks in advance.

 

Daniel Comer

Parents
  • 54937
    Verified Answer
    Offline posted

    There are two things I can think of. Currently the xamDateTimeEditor only supports a date dropdown when the mask of the xamDateTimeEditor contains date related sections (i.e. day, month and/or year). We could possibly alter that logic such that we only prevent the date dropdown when a mask contains time sections but not day sections since really that was the intention - to not show a date dropdown when editing only a time.  With such a change, you could set the mask such that it allows other characters (e.g. &&&&). The other option would be as you mentioned - to provide a custom EditTemplate that contains a textbox as the PART_FocusSite and where you bind its Text property to the Value. In either case you'd probably have logic to convert from the entered text to a DateTime since ultimately the Value of the xamDateTimeEditor will have to be a DateTime if you want to be able to have it update the date in the calendar in the dropdown since the SelectedDate of the xamMonthCalendar in the edit template is bound to the value. The latter option may be better if you want to retain what the user typed as they type it since there would be a level of separation between the actual Value of the xamDateTimeEditor and the text of the textbox.

Reply Children
No Data