Problem in RadMaskedEditBox

12 posts, 1 answers
  1. Vidhya
    Vidhya avatar
    37 posts
    Member since:
    Aug 2010

    Posted 29 Oct 2010 Link to this post

    hi...

    i am using RadMaskedEditBox.....

    after adding Maskededitbox value,i cleared maskedbox.

    but it is cleared but if we try to enter another value it shows old value...

    how to avoid that?
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 03 Nov 2010 Link to this post

    Hi, 

    Please could you give a sample of your code, perhaps with a screenshot too as I am unsure of your issue. 
    Thanks
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Vidhya
    Vidhya avatar
    37 posts
    Member since:
    Aug 2010

    Posted 03 Nov 2010 Link to this post

    ya ok...

    I have attached three image.

    in first image i entered value in Masked editbox(Mask type:Numeric;Mask :f)

    in second image i have cleared that maskededitbox(using radmaskededitbox1.clear())

    in third image i tried to enter next value.but in tat old value is there while entering the other value.it is not cleared.

    how to avoid this?
  5. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 03 Nov 2010 Link to this post

    Hi, 

    The clear method does not seem to clear both the Text and Reset the value. 
    In order to get around this you could reset both of these properties to your default value. 

    E.g. 
    Me.RadMaskedEditBox1.Clear()
     Me.RadMaskedEditBox1.Text = "0.00"
     Me.RadMaskedEditBox1.Value = "0.00"

    hope that helps
    Richard
  6. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 07 Nov 2010 Link to this post

    Hi,

    Did this work for you? If it did, please remember to mark as answer so others can quickly find the solution.
    Thanks
    Richard
  7. Vidhya
    Vidhya avatar
    37 posts
    Member since:
    Aug 2010

    Posted 07 Nov 2010 Link to this post

    Thank you....

    working correctly...
  8. Sergio
    Sergio avatar
    3 posts
    Member since:
    Dec 2013

    Posted 20 Jul 2015 Link to this post

    Even after Clear(), Text= " " and value = " " the result is "_qqeqeqeqweqweqwe_qweqweqweqw_eqwqwe______________"

    Only clears the first caracter

     

    How does one clears the field

     

  9. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 23 Jul 2015 Link to this post

    Hello Sergio,

    Thank you for writing.

    Following the provided information I was unable to reproduce the issue you are facing with the latest version. I have attached my sample project. Could you please specify the exact steps how to reproduce the problem or what is the RadMaskedEditBox setup on your end?

    Feel free to open a support ticket with a sample project replicating the issue. This would be the fastest way to investigate the precise case and assist you further.

    I am looking forward to your reply.
     
    Regards,
    Dess
    Telerik

  10. Mark
    Mark avatar
    35 posts
    Member since:
    Oct 2014

    Posted 17 Mar Link to this post

    Sergio

     

    You have to set the "VALUE" to NULL.  This was posted in another thread.  CLEAR() only clears the "TEXT" of the control. This really is a pain and took me a good hour trying to figure out what the issue was. I came here and saw a few posts about this.  Hopefully, the TELERIK dev team will have a fix that will allow the CLEAR() method clear the TEXT and VALUE at the same time.  We are using the latest release of Telerik 2016.1.216.40.

     

    Hope this helps

  11. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 18 Mar Link to this post

    Hello Mark,

    Thank you for writing.

    The RadMaskedEditBox.Clear clears the Text and the Value property on my end with the latest version. Could you please specify the exact steps how to reproduce the problem with the remained Value after clearing the RadMaskedEditBox? Thus, we would be able to investigate the precise case and assist you further.

    Thank you in advance.

    Regards,
    Dess
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  12. Mark
    Mark avatar
    35 posts
    Member since:
    Oct 2014

    Posted 18 Mar in reply to Dess Link to this post

    Well, I can't attach my examp, so i will put my source code here.  I have a radMaskedEditBox, radTextboxControl & radButton. If you look at the constructor, you will see how I set up the MaskedEditBox. 

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Diagnostics;
    using System.Windows.Forms;
     
    namespace MaskedEditBoxClear
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
                this.radMaskedEditBox1.Mask = "9999999999";
                this.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Standard;
                this.radMaskedEditBox1.PromptChar = Convert.ToChar(" ");
            }
     
            private void radButton1_Click(object sender, EventArgs e)
            {
                string oldText = this.radTextBoxControl1.Text.Trim();
                this.radTextBoxControl1.Clear();
                this.radMaskedEditBox1.Clear();
                this.radTextBoxControl1.Text  = string.Format("Text Value: {1}{0}Value value: {2}{0}{3}", System.Environment.NewLine, this.radMaskedEditBox1.Text ?? "NULL TEXT".Trim(), this.radMaskedEditBox1.Value?.ToString() ?? "NULL VALUE".Trim(), oldText);
                this.radMaskedEditBox1.Focus();
            }
        }
    }

    Notice that each time you add a value to the maskedtextbox, it does clear the text, however, the value doesn't get cleared and once you start typing in the maskededitbox, the original value comes back and is appended to the end of the new value I am typing.  Since I have a MASK of 10 9's, once I have 10 characters in my MaskedEditBox, I can't enter any other values (See gif1.gif)   Now, I know, I can use just change my MASK to "D" and MASKTYPE to numeric and that strange behavor goes away, however, the VALUE still remains (gif2.gif)

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Diagnostics;
    using System.Windows.Forms;
     
    namespace MaskedEditBoxClear
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
                this.radMaskedEditBox1.Mask = "D";
                this.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric;
                this.radMaskedEditBox1.PromptChar = Convert.ToChar(" ");
            }
     
            private void radButton1_Click(object sender, EventArgs e)
            {
                string oldText = this.radTextBoxControl1.Text.Trim();
                this.radTextBoxControl1.Clear();
                this.radMaskedEditBox1.Clear();
                this.radTextBoxControl1.Text  = string.Format("Text Value: {1}{0}Value value: {2}{0}{3}", System.Environment.NewLine, this.radMaskedEditBox1.Text ?? "NULL TEXT".Trim(), this.radMaskedEditBox1.Value?.ToString() ?? "NULL VALUE".Trim(), oldText);
                this.radMaskedEditBox1.Focus();
            }
        }
    }

     

  13. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 18 Mar Link to this post

    Hello Mark,

    Thank you for writing back. 

    The provided code snippet is greatly appreciated. The Clear method should clear the value as well. I have logged it in our feedback portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - feedback item.

    I have also updated your Telerik points.

    Currently, the possible solution that I can suggest is to set the Value to null as well.

    I hope this information helps. If you have any additional questions, please let me know.

    Regards,
    Dess
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for WinForms is Visual Studio 2017 Ready