what mask to enter integer value in MaskEditbox?

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

    Posted 29 Oct 2010 Link to this post

    hi....

    in  my text box i have to enter only integer values.
    so what mask i have to give its properties?
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 03 Nov 2010 Link to this post

    Hi, 

    There is quite a comprehensive demo in the demos that came with the Telerik Controls. 
    You can achieve a numeric only mask with a default value of 0 by setting: 

    Me.RadMaskedEditBox1.Mask = "d"
    Me.RadMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric

    or without a default value by setting
    Me.RadMaskedEditBox1.Mask = "#"
    Me.RadMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric

    Hope that helps
    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

    Thank you for Reply...

    I tried that....

    just i placed radMaskedEditbox and Changed Masktype as Numeric ,Mask as # or d.but the following error is coming..

    Error:startIndex cannot be larger than length of string.
    Parameter name: startIndex
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 03 Nov 2010 Link to this post

    Hello,

    It sounds as though you are selecting the text in the MaskEditBox at a position which is longer than the string in the box.
    Can you check to see if there is anything else you are doing to the string in the box
    Richard
  6. Vidhya
    Vidhya avatar
    37 posts
    Member since:
    Aug 2010

    Posted 03 Nov 2010 Link to this post

    No.i just tried to enter the value.suddenly its shows error.
  7. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 03 Nov 2010 Link to this post

    Hi, 

    I've tried this and can't seem to replicate the error. 
    A couple of questions: 

    1: What version of the controls are you currently using (I'm on the latest 2010 Q2 914 version)
    2: At what point is this error thrown (E.g. when changing the value?) 

    Thanks
    Richard
  8. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 03 Nov 2010 Link to this post

    Hello Vidhya,

    Thank you for writing.

    To add to Richard's suggestions, the available numeric masks can be found at the following links: Masks in RadMaskedEditBox, MSDN.

    As Richard said, in your case in order to only use integer values you should use the following settings:
     
    RadMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric
    RadMaskedEditBox1.Mask = "D"

    We will be awaiting the additional information in case you still need assistance.
     

    Greetings,
    Stefan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. Vidhya
    Vidhya avatar
    37 posts
    Member since:
    Aug 2010

    Posted 08 Nov 2010 Link to this post


    1) I am using 2009 Version.
    2)when i am trying  to enter the value.i shows error.

    In Program.cs

    Line : Application.Run(new Main ());

    Error :ArgumentOutOfRangeException
    startIndex cannot be larger than length of string.
    Parameter name: startIndex
  10. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 08 Nov 2010 Link to this post

    Hello,

    This sounds as though it may not be related to the Telerik controls, nor am I able to replicate your issue.

    As you are using the older versions of the controls, I'd first suggest upgrading to the lastest version. If you still encounter an issue, then please post the code that you are using, showing which line the error occurs on, and I'll do my best to help.

    Thanks
    Richard
  11. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 11 Nov 2010 Link to this post

    Hello Vidhya,

    Thank you for writing back.

    Since I am also not able to replicate your issue and this discussion may take quite a long time until we manage to understand the exact case, I would suggest that you open a new support ticket with a sample project that demonstrates this issue. Additionally, detailed steps on how to reproduce it will be appreciated.

    I am looking forward to your reply.

    Regards,
    Stefan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  12. ShareDocs
    ShareDocs avatar
    76 posts
    Member since:
    Oct 2012

    Posted 06 May 2013 Link to this post

    Hi,
    I tried richard slates sollution:
    Me.RadMaskedEditBox1.Mask = "#"
      
    Me.RadMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric

    with no luck...

    the maskededitorbox won't recieve any key (numbers or chars).

    any idea how i can define a integer only maskededitbox without initial value? I want it to return the same as a textbox...

  13. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 08 May 2013 Link to this post

    Hello Lior,

    The pound character "#" is part of the standard masks, so you will have to set the MaskType to Standard in order to use it:
    RadMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Standard
    RadMaskedEditBox1.Mask = "#"

    Please note that each pound sign represents a single digit, so if you want to use this approach, without an initial value, you need to add as many pound signs as the maximum number of allowed digits in the control. 

    I hope this helps.
     

    All the best,
    Stefan
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
  14. ShareDocs
    ShareDocs avatar
    76 posts
    Member since:
    Oct 2012

    Posted 08 May 2013 Link to this post

    thanks, but I've already put a textbox instead - so much easier to handle

    FYI:
    it is very confusing as you link this msdn Custom Numeric Format Strings article as a numeric masktype reference (editors-maskededitbox-working-with-radmaskededitbox - link through the word 'custom')

  15. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 08 May 2013 Link to this post

    Hi Lior,

    I am glad you have found a suitable solution for your case.

    As to the documentation, I will make sure this gets corrected so the hyperlink will have text "custom numeric masks".
     

    Regards,
    Stefan
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
  16. ShareDocs
    ShareDocs avatar
    76 posts
    Member since:
    Oct 2012

    Posted 08 May 2013 Link to this post

    I meant that it is confusing because you wrote in the post : "The pound character "#" is part of the standard masks"
    and in your site it says: "Numeric - you can define standard and custom numeric masks"

    where inside the 'custom' link it says that pound character is part of it (contrary to what you wrote)
  17. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 13 May 2013 Link to this post

    Hi Lior,

    Thank you for the clarification.

    This is an error in the documentation and RadMaskedEditBox does not support custom numeric masks. The article will be fixed with the next upload.

    Your 
    Telerik Points have been updated for this report.

    Regards,
    Stefan
    the Telerik team
    RadChart for WinForms is obsolete. Now what?
Back to Top
UI for WinForms is Visual Studio 2017 Ready