Hello.
I want TextEdit to restrict EditValue to date ranges with the specified mask "dd/MM/yyyy - dd/MM/yyyy". Works almost perfect for the MaskType=DateTime, but:
- editing left date (begining of date range) changes right date simultaneously
- edit value defaults to Today at the beginning of typing (like "06.07.2010 - 06.07.2010")
Can you help me find a solution for my task using your "Superior Masked Input"?
Btw, i cant use two TextEdit's with Mask="d". Actually i am implementing the control for editing date ranges (DateRangeEdit derived from PopupBaseEdit, like your DateEdit).
Hello,
Our editors have only one EditValue property, and you are able to restrict input for this property (using the mask). You can't create two EditValues for one editor. It's necessary to create two editors with necessary masks. As a sample, I suggest that you review the following sample: How to filter on date ranges. I'm not sure how your editor should work. So, if you need further assistance, please clarify your task in greater detail. Screenshots may be helpful.
Thank you, Marina
P.S. By the way, we cannot find any registered products under your account. Please provide your company's email address, which you specified on the registration screen when installed DXperience.
Thank you for the instant reply, even if it was not that helpful for me.
Let me clarify my problem.
I have ONE editor, and I want the user to be able to input text representing date period like "06.07.2010 - 07.08.2011". Editing experience provided by TextEdit with MaskType="DateTime" and Mask="dd/MM/yyyy" is awesome, and I want similar _editing experience_ for my task.
Please take a look at my first approach (sample 1):
<StackPanel Orientation="Vertical">
<dxe:TextEdit x:Name="textEdit1" Mask="dd/MM/yyyy - dd/MM/yyyy" DisplayFormatString="dd/MM/yyyy - dd/MM/yyyy" MaskType="DateTimeAdvancingCaret" />
<TextBlock Height="21" Text="{Binding DisplayText, ElementName=textEdit1}" />
</StackPanel>
This sample gives me exactly(!) the editing experience I need:
- restricting input chars by numbers only
- restricting day value by range 01…31 and month value by range 01…12
- advancing caret skipping date separators and hyphen in between
- increase/decrease value by UP/DOWN arrows or mouse weel
- … and all the other goodness provided by this mask type
BUT as long as TextEdit "have only one EditValue" it is natural that "editing left date (begining of date range) changes right date simultaneously". And this "but" keeps this solution from perfect.
Please take a look at my second approach (sample 2):
<StackPanel Orientation="Vertical">
<dxe:TextEdit x:Name="textEdit2" Mask="00/00/0000 - 00/00/0000" MaskType="Simple" MaskShowPlaceHolders="False" />
<TextBlock Height="21" Text="{Binding DisplayText, ElementName=textEdit2}" />
</StackPanel>
Not good enough either, because it allows to enter text like "33.55.2222 - 44.66.2222" which is invalid for my task. Speaking nothing about poor editing experience in comparison with DateTime mask type.
I guess that my problem can be solved using powerful Regular Expression Masks.
So the question is how to emulate MaskType=DateTime editing experience with MaskType=RegEx?
PS: have sent company's emal address to support@devexpress.com with subject = "Q265665".
Hello,
Thank you for the clarification. Unfortunately, you can't accomplish your task using the RegEx mask, either. The RegEx mask doesn't provide a way to control input in the DateTime format. For example, you can specify that the first digit in a day can be 0,1,2 or 3, and the second can be from 0 to 9. However, you can't catch that the user enters 39. The other issue that in RegEx won't work, is the advancing caret mode. This is simply impossible. The only correct solution that we see is to place two editors in the UserControl, and them use this UserControl. Let me know if you need further clarification.
Thank you, Marina