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

Disable text selection in RichTextBox but keep scroll bars active

7 Answers 717 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Rich
Top achievements
Rank 1
Rich asked on 03 Aug 2010, 11:28 PM
Hi,

I'm using the RichTextBox as a simple rich text display for some HTML coming out of a database.  I'm able to get the formatted text to display correctly in the RichTextBox but I would like to disable the highlighting and copying of the text.  Setting the "IsEnabled" property to "False" will do that for me but it will also disable the vertical scroll bar as well.

Any ideas how I would accomplish disabling the content area only?  I've tried to explicitly target the content area and just disable that but it doesn't seem to do anything.

Thanks in advance.

7 Answers, 1 is accepted

Sort by
0
Ivailo Karamanolev
Telerik team
answered on 06 Aug 2010, 02:12 PM
Hello Rich,

We are planning to introduce API for more detailed control over the allowed and disallowed actions on RadRichTextBox. However, we're under a lot of pressure for the SP1 release and we didn't have the opportunity to revise this too, so unfortunately I'll have to be delayed for a later release. Feel free to get back if you need any further assistance.

Greetings,
Ivailo
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
Rich
Top achievements
Rank 1
answered on 06 Aug 2010, 02:43 PM
Hi Ivailo,

Thanks for the reply.  For now, it's fine if the control doesn't natively support only disabling the content area and keeping the scroll bar active....I'm just looking for a decent *hack* to get around this.

For instance, I had thought about maybe forcing the RichTextBox to be the height of the full content (not sure how to do this), setting isEnabled to false, and then dropping the whole control inside another control and leveraging the scrollbar from that control instead.  Or perhaps keeping the entire control enabled but layering a transparent rectangle over the content editor area in order to disable any interaction with the content in the control.

Any alternative solutions like this will suffice for me for now.

Thanks,
-rich
0
Ivailo Karamanolev
Telerik team
answered on 06 Aug 2010, 03:58 PM
Hello Rich,

One possible option is to leave the RadRichTextBox to auto, set the layout mode to flow and put it inside a scroll viewer. Another one might be to try to put a transparent hit-testable rectangle over the control leaving just the scrollbars out of the rectangle.
However, using any of these approaches may lead to many intricate issues because the RadRichTextBox is a very complicated control, so it's discouraged. Feel free to get back to us if you have any other questions.

All the best,
Ivailo
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
uthaya
Top achievements
Rank 1
answered on 07 Sep 2010, 09:38 AM
Hello

           I am Using radrichtextbox inside the scrollviewer, it is not is allowed to enter any text why?
Thanks in advance
0
Boby
Telerik team
answered on 10 Sep 2010, 08:37 AM
Hi Uthaya,
RadRichTextBox adds its own scroll bars so you can try remove ScrollViewer control at first place.
If this is not an option for you, or if your issue persists please contact us again and share more details about your scenario or, better, send us a simple project that reproduces it.

Greetings,
Boby
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
uthaya
Top achievements
Rank 1
answered on 16 Sep 2010, 11:56 AM
Thank U, Now it was working good.

 But now i faced another problem, when the user try to select the particular text from the radrichtextbox, its selected but when i release the mouse button, still the selection will be changed according to mouse movement.



0
Alex
Telerik team
answered on 16 Sep 2010, 12:05 PM
Hello uthaya,

Currently there is a bug when releasing the mouse button outside the RadRichTextBox control. In this case you will continue with the selection as the MouseUp event is not handled properly. Fortunately this issue is already fixed and the fix is available in the LIB.

I hope this was helpful.

Kind regards,
Alex
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
Tags
RichTextBox
Asked by
Rich
Top achievements
Rank 1
Answers by
Ivailo Karamanolev
Telerik team
Rich
Top achievements
Rank 1
uthaya
Top achievements
Rank 1
Boby
Telerik team
Alex
Telerik team
Share this question
or