We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

MaskedEditBox Preset input Text problem

Hi all, if we define a mask in the MaskedEditBox the user input is no problem. But how can we reset a user input that the mask will work again. Example Mask: PF:&&&&& The user puts in: PF:12345 If the user reenters the form (anytime) and we prefill the Text-Property then there is: PF:PF:12345 Did we have to parse every Box for cutting and pasting the user input correctly? That would be much work to do so for every different kind of Mask... ? Thank you for helping out Ralf

5 Replies

GP Gurucharan Patwal Syncfusion Team December 4, 2003 12:31 PM UTC

Hi Ralf, Yes, I see this problem. The workaround for the time being would be to parse the Mask of each MaskedEditBox and trim the Text property value appropriately. I have attached a sample application that illustrates this workaround : Sample_Application The Mask used in this sample is PF:&&&&&. I have informed the Essential Tools development team regarding this issue and will update with their inputs on this one. We appreciate your feedback, and thanks for your patience. Regards, Guru Patwal Syncfusion, Inc.


GP Gurucharan Patwal Syncfusion Team December 4, 2003 02:12 PM UTC

Hi Ralf, A better workaround for this problem would be to use the ClipText property of the MaskedEditBox to save the old text value. The reason being - MaskedEditBox only applies text set through the Text property to the Mask positions and not the literal positions. If you change the sample to set the ClipMode to ExcludeLiterals or change this line to this.oldvalue = this.maskedEditBox1.ClipText; it would work as expected. I have attached the modified version of my earlier sample application here : Sample_Application_Modified Please try this and let me know if it helps. Regards, Guru Patwal Syncfusion, Inc.


RH Ralf Huettl December 4, 2003 04:26 PM UTC

Hi Guru, this is a nice workaround but if we allow prompt input (or in our case input of spaces) then the spaces are deleted because this is a literat (ExcludeLiteral). The second problem is if the mask is more complex like PF:&&&&:&&&&-&&&&& these workaround is not working. We must parse every input manually then it works for us. But there hast to be be a formatText to save the user input with the mask correctly. It is not hard to develop (maybe with xml or regular expression grammar) Greetings :-) Ralf


GP Gurucharan Patwal Syncfusion Team December 4, 2003 08:52 PM UTC

Hi Ralf, Thanks for your feedback. The maskedEditBox1.ClipText workaround works fine even for complex masks like PF:&&&&:&&&&:&&&&&, but it does not handle blank spaces well. I will further investigate this issue and update you at the earliest. Thanks for your patience. Regards, Guru Patwal Syncfusion, Inc.


GP Gurucharan Patwal Syncfusion Team December 5, 2003 08:31 PM UTC

Hi Ralf, To handle empty spaces within the text in the MaskedEditBox, the PaddingCharacter property has to be set to a single space character - '' ''. However, there was a bug in the ClipText property that did not return empty mask positions filled with the PaddingCharacter. This has now been taken care of in the source code internally, and the bug fix is expected to be included in the next build of Essential Suite. Thanks for your cooperation, and we appreciate your feedback on this issue. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon