Focusable property doesn't prevent focus on control

1 Answer 354 Views
RichTextEditor TextBox
Jana
Top achievements
Rank 2
Iron
Iron
Iron
Jana asked on 14 Oct 2021, 08:53 AM | edited on 14 Oct 2021, 08:54 AM

Hello,

I would like to display multiline text with a varying text length on my user interface.
As the space on the device display is quite limited, but the displayed text sometimes pretty long, I thought about using a multiline radTextbox or a radRichTextEditor rather than simple labels, as they provide the autoscroll property which would work perfectly for varying text lengthes.
As the textboxes would be there only for displaying purposes (the text shouldn't be editable), i thought their property "focusable = false" would be the solution to prevent the controls from getting focused and therefore from getting edited.
Unfortunately, both the radTextBox and radRichTextEditor stay focusable even if the property is set to false. Also in combination with IsReadOnly = true the controls still gain focus when clicking on them. Is there another property which needs to be modified in combination to make focusable = false work?

Thank you in advance for your help and have a nice day!

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 Oct 2021, 12:49 PM
Hello, Jana,

If you don't want a certain control, RadRichTextEditor or a RadTextBox, to gain focus, it is necessary to set its Enabled property to false. However, this wouldn't allow you scroll the document. Indeed, setting the control as readonly is the suitable approach here. I can suggest you for RadRichTextEditor to hide the caret. Thus, you will be able to view the entire document and perform scrolling but no cursor will be available:
            this.radRichTextEditor1.IsReadOnly = true; 
            this.radRichTextEditor1.CaretWidth = 0;

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Remote troubleshooting is now easier with Telerik Fiddler Jam. Get the full context to end-users' issues in just three steps! Start your trial here - https://www.telerik.com/fiddler-jam.
Jana
Top achievements
Rank 2
Iron
Iron
Iron
commented on 18 Oct 2021, 06:34 AM

Hello Dess,

 

Thank you for your helpful response, this solution works out for me.

Just one last question: May I ask which use the "focusable" property has then?

Dess | Tech Support Engineer, Principal
Telerik team
commented on 18 Oct 2021, 01:20 PM

Hi, Jana,

I am glad that the suggested solution works for your case. As to the Focusable property, it comes from the base RadControl class. Indeed, it serves the purpose for preventing the focus. However, RadRichTextEditor is a more complex control when it comes to handling input and it is not recommend to use it. We will consider to hide it for RadRichTextEditor.

Tags
RichTextEditor TextBox
Asked by
Jana
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or