RadMaskedTextInput - select content with mouse

5 posts, 1 answers
  1. HAG
    HAG avatar
    7 posts
    Member since:
    Feb 2009

    Posted 29 Jul 2013 Link to this post

    Hi

    I'm trying to migrate RadMaskedTextBox to RadMaskedTextInput and I'm experiencing strage behaviour in RadMaskedTextInput:

    I have a TextBox where the content takes half of the TextBox width. With the RadMaskedTextBox I was able to click anywhere in the free part of the TextBox, hold down the mouse button and select the content with a move to the left side.

    In RadMaskedTextInput I have to put the cursor right beside the last character in the TextBox to do this. The free parts of the TextBox just show the normal mouse cursor and not the text-input-cursor.

    Is it possible to activate the behaviour of the old RadMaskedTextBox in the new RadMaskedTextInput for making a text-selection with the mouse?

    Attached you will find 2 pictures:
    The first TextBox on the pictures is the RadMaskedTextInput
    The second TextBox is the RadMaskedTextBox

    Picture1 (StartSelection.jpg) shows the start of the selection and the different cursors. At the point where you can see the cursors, I'm starting to hold down mouse left and move the mouse to the left

    Picture2 (EndSelection) shows that only the text in the RadMaskedTextBox was selected as desired. The text in the RadMaskedTextInput remains unselected.

    To select the text in the RadMaskedTextInput I have to move the cursor to the position shown in picture3 (radmaskedtextinput.jpg)
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 01 Aug 2013 Link to this post

    Hi Christian,

    Thank you for contacting us on this matter. The new RadMaskedInput suite exposes new mechanism for selecting the text of the control. You can try setting the SelectionOnFocus property to SelectAll (read more). By doing so you will be able to select all the text of the control by focusing the control.

    Please try this approach out and let me know if it works for you.

    Regards,
    Pavel R. Pavlov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. HAG
    HAG avatar
    7 posts
    Member since:
    Feb 2009

    Posted 01 Aug 2013 Link to this post

    Hi Pavel,

    thank you for your reply. I have already noticed and testet the SelectionOnFocus property with all possibilities.
    SelectAll solves the problem when the RadMaskedTextInput gets the focus (but it is just a workaround, because sometimes I don't want to select all the content). But if the RadMaskedTextInput already is focused, the problem remains... I (and I think also users in general) don't expect such behaviour from a Text-control.

    The other Telerik controls ( AutoCompleteBox, DateTimePicker, ComboBox, .. ) don't have this behaviour. There, I can select the text as expected.
  5. Answer
    Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 05 Aug 2013 Link to this post

    Hi Christian,

    This behavior may be caused by the Theme that you use. If you are using the Windows8 theme you can try setting the HorizontalContentAlignment property to Stretch. Basically the definition of the control may look like this:

    <telerik:RadMaskedTextInput SelectionOnFocus="SelectAll"
                       telerik:StyleManager.Theme="Windows8"
                       HorizontalContentAlignment="Stretch"
                       InputBehavior="Insert"
                       Mask="a10"
                       Width="200"/>
    I hope this will help you.

    Regards,
    Pavel R. Pavlov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. HAG
    HAG avatar
    7 posts
    Member since:
    Feb 2009

    Posted 06 Aug 2013 Link to this post

    That did it! :) (I was using Windows8 Theme)

    Thank you!
Back to Top
UI for WPF is Visual Studio 2017 Ready