What I'm looking for;
Users want to be able to enter MM/DD/YY format without the "/" as they do it repetitively throughout the day. That input needs to be saved as MM/DD/YYYY in record. So basically user enters MMDDYY which then ACTUALLY formats to MM/DD/YYYY to save. This date needs to be validated against the regular calendar to help ensure it's a valid date. So if they say enter 023012 It would become invalid because there's only 29 days in February. Make sense?
What I've tried;
I primarily do UX/UI work with XAML and my c# is pretty rusty since I wore that hat, but I have users nagging me for it and developers busy on other priorities. So what I tried so far was pretty basic. I created a UserControl with three (3) TextBox's and make it look just like it was one single input field like the rest. Here's the problems I ran into with this approach;
1. Couldn't make the cursor tab to the next field after two characters were entered in the previous one. 2. Couldn't provide any kind of date validation. 3. Didn't find a way I could tie all three fields together to create the string for saving. 3a. Though I could tie them together visually in the UI with something like below and then on the save event just take that current Text for save to have the whole string; <TextBlock> <Run Text="{Binding MMText}"><Run Text="/"><Run Text="{Binding DDText}"><Run Text="/"><Run Text="{Binding YYText, StringFormat='20\{\0}'}"/> </TextBlock> Anyway hope this makes sense, I thought it was something that could be done with Telerik RadMaskedTextBox but so far that's not been successful either.
So quickest question summary, how can I take user input of MMDDYY, turn it into MM/DD/YYYY and have it be a valid date?
Any insight obviously greatly appreciated, my XAML is very strong, my c# well enough I'll still understand just fine. thanks!
No comments:
Post a Comment
Send us your comment related to the topic mentioned on the blog