22 Answers, 1 is accepted
Please could you give a sample of your code, perhaps with a screenshot too as I am unsure of your issue.
Thanks
Richard
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?
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
Did this work for you? If it did, please remember to mark as answer so others can quickly find the solution.
Thanks
Richard
working correctly...
Even after Clear(), Text= " " and value = " " the result is "_qqeqeqeqweqweqwe_qweqweqweqw_eqwqwe______________"
Only clears the first caracter
How does one clears the field
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.
Dess
Telerik
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
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
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();
}
}
}
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.
Dess
Telerik
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.
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.
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
I cannot duplicate this with a new/clean project.
I will continue to try and narrow it down...
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;
}
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
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
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
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?
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";
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