paste multi-line text when AcceptsReturn set to false

5 posts, 1 answers
  1. Vadimir
    Vadimir avatar
    24 posts
    Member since:
    Aug 2013

    Posted 26 Aug 2014 Link to this post

    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
  2. Answer
    Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 27 Aug 2014 Link to this post

    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.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Vadimir
    Vadimir avatar
    24 posts
    Member since:
    Aug 2013

    Posted 27 Aug 2014 in reply to Pavel R. Pavlov Link to this post

    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
  5. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 28 Aug 2014 Link to this post

    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.
     
  6. Vadimir
    Vadimir avatar
    24 posts
    Member since:
    Aug 2013

    Posted 28 Aug 2014 in reply to Pavel R. Pavlov Link to this post

    Feature request is created.:)
Back to Top
UI for WPF is Visual Studio 2017 Ready