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

RadMaskedTextInput: SelectionLength always null

3 Answers 84 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Jannik
Top achievements
Rank 1
Jannik asked on 18 Jul 2014, 08:35 AM
I tried overriding the HandlePaste()-Method, unfortunately the SelectionStart method always give me 0.

Anyone having the same issue?

3 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 22 Jul 2014, 01:28 PM
Hello Jannk,

The title of the forum states that the SelectionLength returns null, but the content of your reply assumes that the SelectionStart returns 0. Can you please clear which one is your issue? However, the SelectionLength property is updated before the HandlePaste() method is executed and this is why when you try to get it is incorrect. 

Can you please tell me why you need to handle the paste of the masked input control? If it is related to a paste bug workaround you can take a look at the following bug item in our feedback portal and see if this is you case. If so, note that this big is fixed and the fix will be available in our next official release by the end of the next week. Otherwise, can you give us more information on your scenario? This way we might think of better approach to implement the desired result.

Regards,
Martin
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.
 
0
Jannik
Top achievements
Rank 1
answered on 23 Jul 2014, 10:52 AM
Hey,

I meant 0, so the topic title is wrong, it should say 0 in that title.

The bug is related to the following item:
http://feedback.telerik.com/Project/143/Feedback/Details/101107-pasting-in-maskedtextinput-should-work-like-in-textbox

In the comments there's a workaround-hint. I've tried to properly implement it, unfortunately I ended up having Problems with SelectionLength / SelectionStart...

Best regards.
0
Martin Ivanov
Telerik team
answered on 28 Jul 2014, 08:44 AM
Hello Jannk,

Thank you for the clarification on the forum's title.

As I mentioned in my last reply, currently, the SelectionLength is updated before the HandlePaste() method is executed. However, keep in mind that the linked bug logged in our feedback portal is not reproducible when you use NoMask (Mask=""). In order to resolve the paste issue you can set the Mask property of the RadMaskedTextInput to an empty string.

<telerik:RadMaskedTextInput Mask=""/>

If you have any particular reason to use Mask you can share it with us. This will allow us to better understand your case and assist you in the adjustment of the masked input control without using the Mask property.

Regards,
Martin
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
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Jannik
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Jannik
Top achievements
Rank 1
Share this question
or