Overwriting MaskedEditBox text

9 posts, 0 answers
  1. Josh Anderson
    Josh Anderson avatar
    83 posts
    Member since:
    Dec 2005

    Posted 02 May 2008 Link to this post

    Another MaskedEditBox question...is the following behavior by design, and if so is there a hack I can employ to stop it:

    I have a MaskedEditBox set up with the mask of "(###) ###-####".  I enter "(800) 555-1212" in the control.  I select all of the text and attempt to type over it to enter a new number.  Nothing happens.  I have to select the text, delete it, then type again or overwrite one character at a time.

    I would like to be able to select the text and begin typing to overwrite it, as with a normal textbox.

    Josh
  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 05 May 2008 Link to this post

    Hello Josh,

    Thank you about your question.

    Indeed, this is the default behavior, and I agree that it is not very intuitive. I redesign it for Q2 2008 of RadControls for WinForms. If time permits, you may see the improved behavior as soon as SP1 next week.

    Unfortunately, there is no workaround that I can suggest at the moment. The behavior is built-in and cannot be overridden. I have updated your Telerik points for the suggestion.

    Please write me back if you have any additional questions regarding the mask box.

     
    Greetings,
    Boyko Markov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Marina Vision
    Marina Vision avatar
    5 posts
    Member since:
    Dec 2009

    Posted 04 May 2010 Link to this post

    Hi,

    I wanted to know if this issue was resolved, or if RadMaskedEditBox supports anything similar to:
    MaskedTextBox box = ...; 
    box
    .InsertKeyMode = InsertKeyMode.Overwrite;

    I need to overwrite the text in RadMaskedEditBox with MaskType=DateTime in dd/MM/yy format.

    I'm using WinForms controls version Q1 2010.

    Thanks,
    Marina
  5. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 10 May 2010 Link to this post

    Hello Marina,

    Thanks for contacting us and for your question.

    I am not quite sure that I correctly understand your question. Could you please share further details on your requirement?

    Thanks for your time.

    Sincerely yours,
    Deyan
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Marina Vision
    Marina Vision avatar
    5 posts
    Member since:
    Dec 2009

    Posted 10 May 2010 Link to this post

    I'l rephrase my question:

    I'm using RadMaskedEditBox with MaskType=DateTime in dd/MM/yy format.
    When I write text in the "dd" part for instance "01", I want it to continue to the "MM" part of the text. Instead, it stays in the "dd" part and overwrites whatever is in there.

    I want the "overwrite" to work on the entire masked text, not just on the part of the mask I'm in.
    Maybe it's not similar to this: box.InsertKeyMode = InsertKeyMode.Overwrite
    but it's what I was hoping for.

    Anothier question - If I set the RadMaskedEditBox .Text to "" it displays an empty text box, but once I enter the RadMaskedEditBox , even if I don't change anything, once I leave it - it displays it's null date value, for example "01/01/1900".
    How can I make sure that when I leave the RadMaskedEditBox and it's value hasn't been set by the user, it still displays an empty textbox? I tried setting it in the Leave event, but it didn't work.
  7. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 11 May 2010 Link to this post

    Hi Marina Vision,

    Thanks for writing back and for the requested details.

    Currently, the RadDateTimePicker does not support the described behavior. We can consider implementing it, but I cannot give you an exact timeframe for that.

    As to the NullDate issue, I tried to reproduce it, but to no avail. Could you please make sure that you are using the latest version of our controls? You can try calling the SetToNullValue method of RadDateTimePicker to clear the text shown in the text-box part of the control.

    I hope this helps.

    Greetings,
    Deyan
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Marina Vision
    Marina Vision avatar
    5 posts
    Member since:
    Dec 2009

    Posted 11 May 2010 Link to this post

    Well, I'm not using RadDateTimePicker, I'm using RadMaskedEditBox.
    The reason I'm not using the RadDateTimePicker is the behavior you've explained - it doesn't support empty strings.
    That's why I thought to use RadMaskedEditBox, but it doesn't work either.

    Is there any control that I can use that supports BOTH masking DateTime types AND empty strings when its value is NULL?

    Marina
  9. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 14 May 2010 Link to this post

    Hi Marina Vision,

    Thank you for contacting us.

    I would suggest that you use the RadDateTimePicker control for entering DateTime values. This control internally uses the RadMaskedEditBox control, but it also adds many additional features such as a popup calendar, null dates support, spin up/down behavior.  It also allows you to put a range of available dates, etc.

    When you set the current value of the RadDateTimePicker control to its NullDate, the control will display the value of the NullText property. Take a look at the following code snippet which sets the Value of the RadDateTimePicker control to NullDate:
    this.radDateTimePicker2.NullText = "Null Text";
    this.radDateTimePicker2.Value = this.radDateTimePicker2.NullDate;

    The result of this is that the RadDateTimePicker control will display the "Null Text" in its text field. If the NullText property is set to an empty string, the control will display an empty string when the Value is equal to the NullDate.

    As to your last question, RadDateTimePicker supports both masking DateTime types and empty strings.

    Do do not hesitate to write back if you need more information or assistance.

    Best wishes,
    Boyko Markov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  10. Marina Vision
    Marina Vision avatar
    5 posts
    Member since:
    Dec 2009

    Posted 16 May 2010 Link to this post

    I think I'll play with it some more, see which control suits me the best.
    Thanks,
    Marina
Back to Top
UI for WinForms is Visual Studio 2017 Ready