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

Cursor Focus problem for InlineUIContainer in RadRichTextBox

3 Answers 53 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Ruyu
Top achievements
Rank 1
Ruyu asked on 07 Sep 2015, 08:31 AM

The InlineUiContainer is allowed to be inserted into RadRichTextBox officially by Telerik.

But there're some problems:

When I insert  a <Textbox> in to  RadRichTextBox 

                        <telerik:InlineUIContainer>
                            <TextBox Width="100" Height="50"/>
                        </telerik:InlineUIContainer>

       The TextBox can be shown in the RadRichTextBox correctly, and input charactors in inner TextBox correctly. But when I press "Backspace", the cursor will jump to to outer RadRichTextBox instead of delete the last character in inner TextBox !

       I used to think it's caused by the Microsoft WPF and Telerik WPF these 2 mechanisms (incompatible).Then I tried to use a RadTextBox, but no this control (with the acceptable reason: no color can be set on this control, so theme is unnecessary). 

       Fortunately, I found a Telerik control called telerik:RadMaskedTextInput, then I tried it as 

                        <telerik:InlineUIContainer>
                            <telerik:RadMaskedTextInput Width="100" Height="50" TextMode="PlainText"/>
                        </telerik:InlineUIContainer>

       But the problem is still !!!!  Press "backspace" in the inner RadMaskedTextInput will make the cursor jump into the outer RadRichTextBox .............

       On the other hand, if you insert a RadRichTextB​ox into a RadRichTextBox ,  the cursor is Okay both in inner and outer RadRichTextBox .

       I'm using ver 2014Q3.

       Then Whether this problem has been fixed now ? If yes , could you please tell me the ver?

       

3 Answers, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 09 Sep 2015, 04:32 PM
Hello ,

RadRichTextBox gets the focus and executes its DeleteCommand when the Backspace is pressed. You could override this command with a custom one with the corresponding logic. I am attaching a sample project, which demonstrates how you could achieve the desired behavior. 

Hope this helps.

Regards,
Tanya
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Matt
Top achievements
Rank 1
answered on 26 Aug 2019, 06:49 PM
This isn't a good solution. There's tons of different hotkeys available in textboxes besides backspace/delete (left/right, ctrl+left/right, shift+left/right, ctrl+shift+left/right, etc). It gets even more complicated when managing selected text (figuring out which direction to extend the selection, etc). Are we expected to re-implement all of these different key combinations or is there some better way to prevent the RadRichTextBox from stealing keyboard focus when a control inside an InlineUIContainer is focused?
0
Tanya
Telerik team
answered on 28 Aug 2019, 01:15 PM

Hello Matt,

I completely agree with you that such an approach is not feasible for any scenario.

We have recently logged a bug report for this behavior: RichTextBox: Keyboard commands are not working for controls inside InlineUIContainer. Please, check its description where you can find a suggestion for working around this issue. Also, make sure you are following the public item so we can notify you when its status changes.

Regards,
Tanya
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
RichTextBox
Asked by
Ruyu
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Matt
Top achievements
Rank 1
Share this question
or