This is a migrated thread and some comments may be shown as answers.

Problem in RadMaskedEditBox

22 Answers 419 Views
MaskedEditBox
This is a migrated thread and some comments may be shown as answers.
Vidhya
Top achievements
Rank 1
Vidhya asked on 29 Oct 2010, 11:44 AM
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?

22 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 03 Nov 2010, 12:09 PM
Hi, 

Please could you give a sample of your code, perhaps with a screenshot too as I am unsure of your issue. 
Thanks
Richard
0
Vidhya
Top achievements
Rank 1
answered on 03 Nov 2010, 01:13 PM
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?
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 03 Nov 2010, 01:37 PM
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
0
Richard Slade
Top achievements
Rank 2
answered on 07 Nov 2010, 12:15 PM
Hi,

Did this work for you? If it did, please remember to mark as answer so others can quickly find the solution.
Thanks
Richard
0
Vidhya
Top achievements
Rank 1
answered on 08 Nov 2010, 05:42 AM
Thank you....

working correctly...
0
Sergio
Top achievements
Rank 1
answered on 20 Jul 2015, 06:18 PM

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

Only clears the first caracter

 

How does one clears the field

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Jul 2015, 10:13 AM
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

0
Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
answered on 17 Mar 2016, 04:04 PM

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

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 18 Mar 2016, 09:52 AM
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.
0
Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
answered on 18 Mar 2016, 12:22 PM

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();
        }
    }
}

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 18 Mar 2016, 02:34 PM
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 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.
0
Joe
Top achievements
Rank 2
answered on 24 Mar 2017, 02:58 PM

Hello;

I just spent about two hours chasing this down as I am having the same issue.

It does not happen if masked type = none.

I am using the latest version of the control and I have to set both the text="" and value = null.

The clear method does not work correctly still.

0
Joe
Top achievements
Rank 2
answered on 24 Mar 2017, 03:08 PM

a bit more info --

The control does not seem to work correctly at all with the following settings:

Masktype = standard

mask = >CCCCCCCCCC  or mask = >aaaaaaaaaa or mask = CCCCCCCC

After setting the value = null (or using the clear method) the control no longer returns values as expected.

even if you set it's text = "text" the value remains null.

0
Joe
Top achievements
Rank 2
answered on 24 Mar 2017, 03:11 PM

Some more info --

The control does not seem to function properly after either using the clear method or setting its value=null.

Once you do that, even if you set the text = "test" (or enter data into the control field) the value remains null.

if you turn the masktype = none it works.

tested with mask = CCCCCCC, mask=aaaaaaa and mask = >aaaaaaaaa

 

0
Joe
Top achievements
Rank 2
answered on 24 Mar 2017, 03:28 PM

I cannot duplicate this with a new/clean project.

I will continue to try and narrow it down...

0
Joe
Top achievements
Rank 2
answered on 24 Mar 2017, 04:01 PM

The maskedEditText box does not work correctly.

I cannot upload a project as even a basic one is over 20 mb.

I am using VS 2017

new radforms project

1 maskediedtbox
2 labels
2 buttons

run

enter text

click on show - it hows both the text and value properties correctly

click clear - it shows the values preclearing then executes the clear().

now enter data 

click show - value is now null and will no longer take data.

It acts goofy in other ways but I can't nail it down.

I cannot upload the project.  It is a extremely basic project but still over your 20mg limit.

Here is all the code:

 You should be able to recreate it quickly using this.

 

public RadForm1()
       {
           InitializeComponent();
       }
 
       private void radButton1_Click(object sender, EventArgs e)
       {
           
           radLabel1.Text = "pre clear value = " + order_city_eb.Value;
           radLabel2.Text = "pre clear text = " + order_city_eb.Text;
           order_city_eb.Clear();
       }
 
       private void radButton2_Click(object sender, EventArgs e)
       {
           radLabel1.Text = "value = " + order_city_eb.Value;
           radLabel2.Text = "text = " + order_city_eb.Text;
 
       }

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 28 Mar 2017, 10:01 AM
Hello Joe, 

Thank you for writing.  

Following the provided information, I was unable to reproduce the issue you are facing. Please refer to the attached gif file illustrating the behavior on my end with the latest version. Am I missing something? I have attached my sample project. Could you please specify the exact steps how to reproduce the problem? I would recommend you to open a support ticket where you can provide a sample project demonstrating the undesired behavior. Thus, we would be able to make an adequate analysis of the problem and assist you further. Thank you.
 
Should you have further questions I would be glad to help.

 Regards,
Dess
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Joe
Top achievements
Rank 2
answered on 28 Mar 2017, 01:04 PM

Hello -- 

 

Thank you,  I replyed to the open toubleticket.

But basically, you need to set the mask properties using the property editor in visual studio.

Then use a .Clear() vs manually clearing them out.

I sent a project that demonstrates it.

 

Joe

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 29 Mar 2017, 09:38 AM
Hello Joe, 

Thank you for writing back. 

We will continue the communication in the support ticket that you have opened on the same topic. However, to share with the community, note that it is necessary to set the MaskType property to Standard when you specify the Mask containing "C" (Character, optional).

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

Regards,
Dess
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Joe
Top achievements
Rank 2
answered on 29 Mar 2017, 11:37 AM

Thank you, and I will update the support ticket as well.

However, setting the Mask type to 'none' and the Mask to "" results in the same behavior.

This is not the expected behavior - the control works the first time, then after a Clear() it does not work.

That cannot be intended?

0
Joe
Top achievements
Rank 2
answered on 29 Mar 2017, 11:52 AM

I also figured out another place that was causing a error.

If you programmatically set the controls .Text property it leaves the .Value at Null, even though the control shows the correct value in the UI.

This will cause the program to fail:

radMaskedEditBox1.Text = "Joe Ruder";

 

//This would work:

radMaskedEditBox1.Value = "Joe Ruder";

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 30 Mar 2017, 09:36 AM
Hello Joe, 

Thank you for writing back. 

I have logged it in our feedback portal and I have added a vote for it on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to use MaskType.Standard.

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

Regards,
Dess
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
MaskedEditBox
Asked by
Vidhya
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Vidhya
Top achievements
Rank 1
Sergio
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
Joe
Top achievements
Rank 2
Share this question
or