Can I change the input behaviour of a DateTimePicker control? - winforms

The default input behaviour of the DateTimePicker when entering a date is like this:
YYYY(Right Arrow)MM(Right Arrow)DD
The user want to enter the date like this:
YYYYMMDD
Is there any simple way of modifying the input behaviour of the DateTimePicker so that is does behave like the user want it to?
TIA

Expanding on PoweRoy's answer. Use a textbox and a datetimepicker. Make the datetimepicker small (just as big as the drop down arrow) and place it next to (or even inside) the textbox. Then you hook the dropdown and closeup events of the datetimepicker to get the value to and from the editbox.

I don't know how you use the DateTimePicker but what about using a simple editbox? (and validate date when a date is entered)
DateTimePicker is mostly used to choose a date without entering any number.

Related

Can I use a DateTimePicker from #material-ui/pickers without having to render a TextField?

I would like to use the DateTimePicker component from #material-ui/pickers without having to render a TextField. In the designs for the feature I am working on, the date picker is brought up by pressing a button, not a text field.
It seems that the picker is always rendered as a TextField. When focused, the actual date/time picker shows up.
The documentation shows an example of how to programmatically open the picker https://material-ui-pickers.dev/guides/controlling-programmatically. The problem is that it still comes with a TextField.
I have also seen you can use individual pieces of the picker like Calendar or ClockView to build your own. Ideally, I'd rather avoid reinventing the wheel as much as possible.
Thanks!

Edit the date using DateTimePicker

I am able to edit month,date and year by using TAB or Arrow keys(MM-dd-yyyy). I have doubt is this possible to edit total date format at a time (not using tab key or any arrow keys).
No, I don't think this is possible. From Using the DateTimePicker Control
The DateTimePicker operates as a masked edit control for entering date and time values. Each part of the date or time is treated as a separate field within the edit portion of the control. As the user clicks on each field, it is highlighted and they can use the up and down arrow keys to increment or decrement the value of the field. The user can also type values directly into the control, where applicable.

silverlight datepicker show original 'incorrect date' text

I'm using the Silverlight Toolkit DatePicker control.
If an user enters an invalid format date for example foo/bar/2001 then the DatePicker automatically 'ignores' the date and sets it back to the last date.
This behaviour is fine, except I'd like to actually show the date in error to the user (not corrected) and display some validation message etc so the user knows what the issue is
Does anyone have a snip or sample I can use that works in this way?
Any help greatly appreciated.
You could handle the DateValidationError event. Calendar control in Silverlight using C# has a bit of sample code showing how the event handler could be wired up.

Is there a extjs based datetimepicker?

Is there a extjs based datetimepicker?
I want user can select date and time together.
Unfortunately there is not a DateTimePicker out of the box, but there are two separate components named TimeField and DateField that can be used in conjunction to get the functionality you desire.
If you'd rather use Saki's DateTime user extension, take a look at DateTime Field. The class comments describe DateTime as "[a] combination of DateField and TimeField", so nothing too crazy is going on if you'd like to create your own unique version.
Check out Saki's DateTimeField: at http://www.extjs.eu/
"Combined Date and Time Field for applications where entering both date and time is required. Suitable also as Grid Editor. Contains renderer directly usable by grids."
There's also this one, works in ExtJS 4.1, but uses number spinners for selecting time, can be reworked relatively easily to use the built-in time picker.

DateTimePicker resets day

I am using DateTimePicker with Australian date formatting set (dd/mm/yyyy)
The problem is when user enters a day which is outside of the month (mm), control resets that day to "1".
This obviously is a quite confusing obstacle for user - it's not natural to enter the month first and then enter the day [culture-wise]
Is there a way to disable this validation or postpone it till say,when control loses focus?
Thanks!
I've tried and I do not see anyway we can disable this for on micro-validation via the DateTimePicker's properties.
I know your frustration when the current date is "09/11/2009" (dd/MM/yyyy) and a user wants to enter "31/12/2009" via the keyboard from left to right.
Upon htting "31", it'll revert to "1" as Nov has only 30 days. It will show "2" if "32" is entered.
It forces the user to enter the month first followed by the day. I.e. entering in the direction of right, left, far-right.
My suggestion is use a more generic form of format like yyyy-MM-dd which though does not follow your regional/cultural format, still is easily understood by the user (or Aussie friends).
Another option might be to instantiate an edit control and overlay it on top of the date time picker's edit, and use the value to set the date time picker's value. Of course, you'll need to do some validation before doing the setting; and you'll also want to mimic the way the date time picker's edit field allows you to select the date, month and year individually.

Resources