RadTextBox cursor position changes when TextChanging event is cancelled

6 posts, 1 answers
  1. Joel Kraft
    Joel Kraft avatar
    87 posts
    Member since:
    Jan 2004

    Posted 22 Jul 2010 Link to this post

    I'm not sure if this is a bug or by design. I handle the TextChanging event of a RadTextBox to prevent users from entering invalid characters. If they enter an invalid character, I set e.Cancel to false. While the text does not change, the cursor returns to beginning of the textbox. This is annoying if you don't notice you typed an invalid character. For example, if I were typing "Hello, world" and canceled the event as the space was typed, the TextBox would now read "worldHello,"

    If it matters, I haven't upgraded to Q2 yet.
  2. Answer
    Boryana
    Admin
    Boryana avatar
    330 posts

    Posted 28 Jul 2010 Link to this post

    Hi Joel Kraft,

    Thank you for contacting us.

    Telerik controls are designed to mimic the behavior of the standard Windows Forms controls. In this sense the behavior of RadTextBox that you are experiencing is by design. However, you are right that the behavior does not seem to be convenient for the end user. The only workaround I can suggest you is illustrated in the attached sample project.

    I hope it meets your requirements. Let me know if I can assist you further.

    Kind regards,
    Boryana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Joel Kraft
    Joel Kraft avatar
    87 posts
    Member since:
    Jan 2004

    Posted 28 Jul 2010 Link to this post

    Boryana, Thanks for the code, it works beautifully!
  5. Boryana
    Admin
    Boryana avatar
    330 posts

    Posted 30 Jul 2010 Link to this post

    Hello Joel Kraft,

    I am glad to hear that the provided solution meets your requirements. Feel free to mark my answer as an answer.

    Do not hesitate to contact me back, in case of further issues.

    Greetings,
    Boryana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Rohan
    Rohan avatar
    94 posts
    Member since:
    Jul 2012

    Posted 15 Oct 2012 Link to this post

    Hi all,
    How to set the cursor position at the end of the radtextbox .....
  7. Boryana
    Admin
    Boryana avatar
    330 posts

    Posted 18 Oct 2012 Link to this post

    Hello Rohan,

    Thank you for writing.

    Would you please confirm that you are using RadTextBox for WinForms? If this is the case, please provide further information about your scenario, as the sample project positions the cursor at the end of the text box indeed. In case you are using the RadTextBox of a different suite, e.g. ASP. NET AJAX, please open a new forum thread in the correct forum.

    Regards,
    Boryana
    the Telerik team
    You’ve been asking for it and now it’s time for us to deliver. RadControls for WinForms Q3 2012 release is just around the corner. Sign up for a free webinar to see first all the latest enhancements.
Back to Top
UI for WinForms is Visual Studio 2017 Ready