Selection in DateTimeEditBox

Editors for WPF Forum

Posted 14 years ago by duyhai707
Avatar
Hi actipro team,
We want to customize date time edit box, could you please help me these step customize?

- select the full date (day, month and year) in one time in order to change it.
- select the full time (hour, minute) in one time in order to change it Selection of ony one part of the date or time must be not allowed (only day only year, ...)

Thanks,
Regards.

Comments (4)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hello,

Unfortunately, that's not how the DateTimeEditBox (which is a parts-based editor) is designed to work. It was designed to allow individual parts (i.e. day, month, year) to be modified, not the entire date and/or time.

You could probably build a custom parts-based editor that leverages our MaskedTextBox. In the MaskedTextBox you could then specify a custom Mask (i.e. "\d\d/\d\d/\d\d\d\d") to allow the entry of an entire date. Then you'd include another MaskedTextBox for the time. We have a QuickStart that shows how to build a custom parts-based editor.


Actipro Software Support

Posted 14 years ago by duyhai707
Avatar
Could you please explain more? We do not use editor DateTimeEditBox, we only use MaskedTextBox for this requirement?
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hello,

That's correct, the DateTimeEditBox does not support the behavior you describe. So you'd have to build a custom control to achieve that behavior.

You may be able to leverage our MaskedTextBox and/or build a custom parts-editor to get the look/feel you want. It sounds like you want two parts, one for the Date and one for the Time. If that's the case, you could probably build a custom parts-editor that leverages our MaskedTextBox (to restrict input to a known format).

We have a Custom PartEditBox (SSN) QuickStart that shows how to build a custom-parts-editor for a U.S. Social Security Number. You would need to take that an change it to have two parts: one for Date and one for Time. Each of those parts has a MaskedTextBox in their control template. The MaskedTextBox can specify a mask to restrict what the user can enter. So you'd restrict the input of the Date part to only be a valid date format, and the same for time.


Actipro Software Support

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Maria,

Unfortunately, yes. We do not have parts that display/update the entire date and/or time. Instead the parts display/update distinct elements (such as month, day, year, hour, etc).


Actipro Software Support

The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.