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

IP Mask doesn't produce valid IP address

5 Answers 291 Views
MaskedEditBox
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 17 Nov 2011, 07:53 PM
I've just replaced a competitor's IP address mask input control with Telerik's Winforms 2011 Q2 and I'm disapointed with the functionality. Dropping the RadMaskedEditBox in place with MaskType = IP presented two problems:

When typing an IP address of 10.5.2.97 (with periods) it ends up '10 .5 .2 .97' in the box and requires custom reformatting to remove embedded spaces to make it into a valid IP address. Am I missing something? 

Second and much more minor issue is that I could not find an easy way to make this controls blue border look the same as standard .NET controls of black; changing the Theme to ControlDefault did not work.

5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 21 Nov 2011, 04:41 PM
Hello John,

Thank you for writing.

In order to get the RadMaskedBox's Value property without spaces you should set TextMaskFormat property to ExcludePromptAndLiterals.

this.radMaskedEditBox1.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;

As to the second question, please open at design time the RadMaskedEditBox Smart Tag (refer to the attached screenshot) and click Edit UI elements, then select Border Primitive and set ForeColor to the desired color. 

I hope this helps.

 Best wishes,
Peter
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

0
John
Top achievements
Rank 1
answered on 21 Nov 2011, 07:02 PM
This property does not exist (at least I could not find it in the documentation or  Object Browser):

this
.radMaskedEditBox1.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;


I'm using the latest version of this control (Winforms 2011 Q3). Please advise.  Thanks.
0
Peter
Telerik team
answered on 22 Nov 2011, 11:45 AM
Hi John,

Thank you for writing back.

We introduced this property in Q3 2011 (exact version 2011.3 11.1116)

The TextMaskFormat property determines how the literal and prompt characters in the mask are processed when the generating the Value Property. 

I hope this helps.

Regards,
Peter
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

0
John
Top achievements
Rank 1
answered on 12 Mar 2012, 10:43 PM
There are two issues with using ExcludingPromptAndLiterals:
1) this property must be set at runtime, always defaults to IncludePromptAndLiterals if set to something else at design time.
2) How can this produce a valid IP address (my original request) whe the literals are removed. Try inputing 10.1.1.5 and you'll get 10115 returned. Changing it to IncludeLiterals does not help, back to square one.

0
Peter
Telerik team
answered on 15 Mar 2012, 10:58 AM
Hi John,

Thank you for contacting us.

I can confirm the issue with TextMaskFormat - it will be addressed in our next release scheduled for the next week.

For IP Mask you should set the TextMaskFormat property to MaskFormat.IncludeLiterals in order to keep the delimiters between IP parts - we will consider providing a more convenient way for this in one of the future releases.

Please excuse us for the inconvenience. I have added points to your account for the reports. Do not hesitate to contact us if you have other questions.

Kind regards,

Peter
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
MaskedEditBox
Asked by
John
Top achievements
Rank 1
Answers by
Peter
Telerik team
John
Top achievements
Rank 1
Share this question
or