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

Null Text and Placeholder.

10 Answers 1420 Views
MaskedEditBox
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 2
Jonathan asked on 20 Aug 2008, 05:13 AM
Hi there,

I'm trying to set up a MaskedEditBox that takes in digits only and displays a null text instead of the default place holder value and I cant seem to get it to work.

It seems that when I change the masktype, the null text doesnt work anymore :(

Can I get some sort of tips to fix this?

relevant attributes:
Mask = "000000" --> (6 digits)
MaskType = "Standard"
NullText = "Enter Digits Here"
PlaceHolder = "_"

cheers,
Jonathan

10 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 22 Aug 2008, 08:45 AM
Hello Jonathan,

Thank you for writing.

To show null text in RadMaskedEditBox you have to set its Text property to an empty string and move the focus to another control. Please, review the code-block below as example:
private void Form1_Load(object sender, EventArgs e) 
    this.radMaskedEditBox1.Mask = "0000000"
    this.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Standard; 
    this.radMaskedEditBox1.NullText = "My null text"
    this.radMaskedEditBox1.PlaceHolder = '_'; 
    this.radMaskedEditBox1.Text = string.Empty; 
 
    this.SelectNextControl(this.radMaskedEditBox1, truefalsefalsetrue); 
 
    this.radMaskedEditBox1.TextChanged += new EventHandler(radMaskedEditBox1_TextChanged); 
     
 
void radMaskedEditBox1_TextChanged(object sender, EventArgs e) 
    if (this.radMaskedEditBox1.Value.ToString() == string.Empty) 
    { 
        this.radMaskedEditBox1.Text = string.Empty; 
    } 


If you have other questions, do not hesitate to contact me again.

Greetings,
Martin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jonathan
Top achievements
Rank 2
answered on 08 Sep 2008, 07:32 AM
Hi Martin,

Thanks for the update on setting null text on the maskededitbox.

Unfortunately, I discovered a weird behaviour in the maskededitbox and would like your help with that.

I have a maskededitbox and a radtextbox in a winform and I would like to reset the maskededitboxvalue back to nothing when I click on the radtextbox.

I used maskededitbox.value = ""; but it doesnt seem to work.

can you help please?
0
Martin Vasilev
Telerik team
answered on 10 Sep 2008, 04:06 PM
Hello Jonathan,

Thank you for getting back to me.

Please try setting RadMaskEditBox Text property to an empty string in a combination with using the Clear method:
private void radTextBox1_Enter(object sender, EventArgs e) 
    this.radMaskedEditBox1.Text = String.Empty; 
    this.radMaskedEditBox1.Clear(); 

I hope this helps. Contact me again if you need additional assistance.

Regards,
Martin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jonathan
Top achievements
Rank 2
answered on 11 Sep 2008, 01:31 AM
Hi Martin,

Your suggestion didnt work. :(
I think there's a bug on the radMaskEditBox control.

I have tried your suggestion below and it does reset the text to null such that the the null text gets displayed. furthermore, when you click on the control, the null text is removed so that there's an empty textbox.

However, when you start keying something into the box, the previous value will be displayed.

private void tbxActivityId_Enter(object sender, EventArgs e)
        {
            // Set the textbox to empty for user input                       
            tbxActivityId.Text = string.Empty;
            tbxActivityId.Clear();                       
        }
0
Martin Vasilev
Telerik team
answered on 12 Sep 2008, 04:16 PM
Hi Jonathan,

Thank you for contacting me again.

I have done some tests and I confirm that when MaskType is set to something different from None it could not be cleared the RadMaskedEditBox Value. We will address this in some of the next releases. Currently you could workaround it by changing the MaskType to None before clearing the text box value. Please, find a small example application that demonstrates this approach as attachment.

I have updated your Telerik points for bringing our attention to this issue.

I hope this helps. If you need additional assistance, please contact me again.

 
Greetings,
Martin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Dino
Top achievements
Rank 1
answered on 04 Jan 2014, 10:07 PM
Hi Martin,

This RadMaskedEditBox issue is still there after 5 years of releases...

Regards,
Dino
0
Dimitar
Telerik team
answered on 06 Jan 2014, 02:06 PM
Hi Dino,

Thank you for writing.

This case is already logged in our Public Issue Tracking System, but it appears that it is not resolved for all cases. This is why I have changed the status of the item. You can track it for status changes and add your vote for it here.

Nevertheless, until this is resolved you can use the workaround that is provided in the issue corresponding page.

Do not hesitate to contact us if you have other questions.

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Jay
Top achievements
Rank 1
answered on 18 Jun 2014, 05:22 PM
It would be nice to be able to easily clear the value, this isn't something we should be voting on, this is a bug
0
Jonathan Zee
Top achievements
Rank 1
answered on 19 Jun 2014, 01:09 AM
Wow...I didn't know its still unresolved.

In the end, I reverted back to a normal textfield.



0
Dimitar
Telerik team
answered on 20 Jun 2014, 11:56 AM
Hello guys,

The fix for this is available with Q1 2014 version of our suite. The item link in our new Feedback Portal is as follows: UI for Winforms Feedback Portal - FIX. RadMaskedEditBox - NullText is not displayed when value is set to null.

Please note that we use the voting system to prioritize the issues and feature requests. And Issues that have more votes get higher in our priority list.

I hope this helps.

Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
MaskedEditBox
Asked by
Jonathan
Top achievements
Rank 2
Answers by
Martin Vasilev
Telerik team
Jonathan
Top achievements
Rank 2
Dino
Top achievements
Rank 1
Dimitar
Telerik team
Jay
Top achievements
Rank 1
Jonathan Zee
Top achievements
Rank 1
Share this question
or