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

paste multi-line text when AcceptsReturn set to false

4 Answers 115 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Vadimir
Top achievements
Rank 1
Vadimir asked on 26 Aug 2014, 02:51 PM
Hi,
I have a RadMaskedTextInput with both AllowInvalidValues and AcceptsReturn set to false. When user pastes a multi-line text into the control, the control accepts the multi-line text, and changes its height. Is there a way to reject the input and keep the height?

Thanks.
Gong

4 Answers, 1 is accepted

Sort by
0
Accepted
Pavel R. Pavlov
Telerik team
answered on 27 Aug 2014, 11:59 AM
Hi Gong,

The AcceptsReturn property is designed to restrict the input of the user when (s)he actually presses the return key. If (s)he pastes any multiline text it is up to you to customize the pasted text and to control the visualization of the RadMaskedTextInput. You can do this by subscribing to the ValueChanged event of the control. In its handler you will be able to detect if there are any new lines and returns and you will be able to change the Value of the component.

Regarding your second requirement you can try setting fixed height of the control to restrict it from resizing.

Regards,
Pavel R. Pavlov
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
Vadimir
Top achievements
Rank 1
answered on 27 Aug 2014, 01:53 PM
Thanks, Pavel. I implemented the ValueChanging event handler to detect the new lines.
I think it would be great to have a IsMultilineAllowed property for this control, as AcceptsReturn property is only designed to ignore the return key entered by the user.

Regards,
Gong
0
Pavel R. Pavlov
Telerik team
answered on 28 Aug 2014, 11:12 AM
Hello Gong,

Thank you for your feedback. Please note that you can log your suggestion as a FeatureRequest in our feedback portal

Regards,
Pavel R. Pavlov
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
Vadimir
Top achievements
Rank 1
answered on 28 Aug 2014, 11:22 AM
Feature request is created.:)
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Vadimir
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Vadimir
Top achievements
Rank 1
Share this question
or