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

what mask to enter integer value in MaskEditbox?

15 Answers 473 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, 10:37 AM
hi....

in  my text box i have to enter only integer values.
so what mask i have to give its properties?

15 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 03 Nov 2010, 12:07 PM
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
0
Vidhya
Top achievements
Rank 1
answered on 03 Nov 2010, 12:59 PM
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
0
Richard Slade
Top achievements
Rank 2
answered on 03 Nov 2010, 01:22 PM
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
0
Vidhya
Top achievements
Rank 1
answered on 03 Nov 2010, 01:28 PM
No.i just tried to enter the value.suddenly its shows error.
0
Richard Slade
Top achievements
Rank 2
answered on 03 Nov 2010, 01:40 PM
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
0
Stefan
Telerik team
answered on 03 Nov 2010, 07:21 PM
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
0
Vidhya
Top achievements
Rank 1
answered on 08 Nov 2010, 06:03 AM

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
0
Richard Slade
Top achievements
Rank 2
answered on 08 Nov 2010, 08:50 AM
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
0
Stefan
Telerik team
answered on 11 Nov 2010, 02:47 PM
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
0
ShareDocs
Top achievements
Rank 1
answered on 06 May 2013, 07:22 AM
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...

0
Stefan
Telerik team
answered on 08 May 2013, 12:04 PM
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.
0
ShareDocs
Top achievements
Rank 1
answered on 08 May 2013, 12:12 PM
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')

0
Stefan
Telerik team
answered on 08 May 2013, 12:30 PM
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.
0
ShareDocs
Top achievements
Rank 1
answered on 08 May 2013, 03:19 PM
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)
0
Stefan
Telerik team
answered on 13 May 2013, 12:31 PM
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?
Tags
MaskedEditBox
Asked by
Vidhya
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Vidhya
Top achievements
Rank 1
Stefan
Telerik team
ShareDocs
Top achievements
Rank 1
Share this question
or