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

RadTextBox cursor position changes when TextChanging event is cancelled

5 Answers 260 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Joel Kraft
Top achievements
Rank 2
Joel Kraft asked on 22 Jul 2010, 09:31 PM
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.

5 Answers, 1 is accepted

Sort by
0
Accepted
Boryana
Telerik team
answered on 28 Jul 2010, 12:27 PM
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
0
Joel Kraft
Top achievements
Rank 2
answered on 28 Jul 2010, 06:01 PM
Boryana, Thanks for the code, it works beautifully!
0
Boryana
Telerik team
answered on 30 Jul 2010, 05:28 PM
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
0
Rohan
Top achievements
Rank 1
answered on 15 Oct 2012, 12:56 PM
Hi all,
How to set the cursor position at the end of the radtextbox .....
0
Boryana
Telerik team
answered on 18 Oct 2012, 11:16 AM
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.
Tags
TextBox
Asked by
Joel Kraft
Top achievements
Rank 2
Answers by
Boryana
Telerik team
Joel Kraft
Top achievements
Rank 2
Rohan
Top achievements
Rank 1
Share this question
or