Welcome Guest Search | Active Topics | Sign In | Register

MaskedEdit and Short Time Options
Dan Lasante
Posted: Tuesday, March 6, 2012 9:00:50 AM
Rank: Newbie
Groups: Member

Joined: 1/31/2012
Posts: 8
I placed a maskededit and used the Short Time mask. I've tried to modify segments but can't get the result I need. When the user enters the time eg. 08:02 AM, the displayed time changes to _8:_2 AM. I tried to modify the segments but haven't been able to figure out how to keep the leading zero.

Thank you for your help.
eo_support
Posted: Tuesday, March 6, 2012 10:36:40 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

There isn't a clean way to do that. There are two workarounds:

1. Change the hour and minute segment from Number segment to Mask segment. For example, the hour segment looks like this:

Code: HTML/ASPX
<eo:MaskedEditSegment MaxValue="12" MinValue="1" SegmentType="Number" />


You can change that to:

Code: HTML/ASPX
<eo:MaskedEditSegment Mask="99" SegmentType="Mask" />


This will keep the 0 digits however it won't enforce the min/max value range as a Number segment would.

2. Using two separate MaskedEdit controls. The first MaskedEdit control would have three segments: hour, ":" and minute. The second MaskedEdit control would have a single "AM|PM" choice segment. You can then set the first MaskedEdit control's PromptChar to "0". This will display "0" for all "empty" positions. It is necessary to use a separate MaskedEdit control for the "AM|PM" choice because otherwise it would also display "00" there.

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!
Dan Lasante
Posted: Tuesday, March 6, 2012 10:43:55 AM
Rank: Newbie
Groups: Member

Joined: 1/31/2012
Posts: 8
I replaced the number segment with a masked segment and that worked perfectly. I get the results I'm looking for. Thank you for the quick reply and suggestion.
eo_support
Posted: Tuesday, March 6, 2012 11:17:17 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
You are very welcome. Please feel free to let us know if you need anything else.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.