Null Text and Placeholder.

11 posts, 0 answers
  1. Jonathan
    Jonathan avatar
    14 posts
    Member since:
    Jun 2008

    Posted 20 Aug 2008 Link to this post

    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
  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 22 Aug 2008 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jonathan
    Jonathan avatar
    14 posts
    Member since:
    Jun 2008

    Posted 08 Sep 2008 Link to this post

    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?
  5. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 10 Sep 2008 Link to this post

    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.
  6. Jonathan
    Jonathan avatar
    14 posts
    Member since:
    Jun 2008

    Posted 10 Sep 2008 Link to this post

    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();                       
            }
  7. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 12 Sep 2008 Link to this post

    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.
  8. Dino
    Dino avatar
    1 posts
    Member since:
    Sep 2011

    Posted 04 Jan 2014 Link to this post

    Hi Martin,

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

    Regards,
    Dino
  9. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 06 Jan 2014 Link to this post

    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 >>
  10. Jay
    Jay avatar
    6 posts
    Member since:
    Apr 2009

    Posted 18 Jun 2014 Link to this post

    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
  11. Jonathan Zee
    Jonathan Zee avatar
    22 posts
    Member since:
    Mar 2009

    Posted 18 Jun 2014 Link to this post

    Wow...I didn't know its still unresolved.

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



  12. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 20 Jun 2014 Link to this post

    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.
     
Back to Top
UI for WinForms is Visual Studio 2017 Ready