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
435
Timecode Mask
posted

Hi Infragistics,


We have a need for an editable video timecode field in an application. We'd like to xamMaskedInput (v2014) but have hit a problem with some (optional) special characters.

 

The basic timecode is this...

 

HH:MM:SS:FF

 

Where...

 

HH = 00 - 99

MM = 00 - 59

SS = 00 - 59

FF = 00 - 24

 

And this mask works ok (with a PromptChar of "")...

 

{number:0-99}:{number:0-59}:{number:0-59}:{number:0-24}

 

But we would like some optional characters at the beginning and end, which the user will enter in certain situations. At the beginning we would like either a "+" or "-" and at the end a "*"

 

So...

 

[+ or -]HH:MM:SS:FF[*]

 

I've managed to add the "*" with the following mask at the end...

 

{char:1:*}

 

But I've tried to get "+" and "-" working and just can't seem to find a way using the standard masks...

 

http://ko.infragistics.com/help/wpf/xaminputs_masks.html

 

The "-" and "+" masks already defined, don’t work for this situation.


Is it also possible to have the ":" literals in the above example only appear when the cursor has reached the correct position?


Using a PromptChar of "" the initial edit text looks like this...


::::


Which is not ideal. We've tried using a PromptChar of "0" but then the "*" mask looks odd.


It sounds like this is too custom for xamMaskedInput  and maybe we need a masked control using Regex support?


Any help would be much appreciated.

Parents
  • 138253
    Offline posted

    Hello,

     

    Thank you for your post. I have been looking into it and it seems like that it is better to use regular expression than Mask in order to achieve the functionality you want. You can set a regular expression like this:

    <ig:XamMaskedInput  >
        <ig:XamMaskedInput.ValueConstraint>
            <ig:ValueConstraint RegexPattern="your regEx pattern"/>
        </ig:XamMaskedInput.ValueConstraint>
    </ig:XamMaskedInput>

     

    Please let me know if you have further questions on this matter.

     

    Looking forward for your reply.

Reply Children