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

Disabling selection / readonly

1 Answer 49 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
ITLackey
Top achievements
Rank 1
ITLackey asked on 08 May 2013, 08:39 PM
I am having an issue when I set the richtextbox IsReadOnly to true and even with IsSelectionEnabled set to false I am still able to drag elements around inside of the textbox. Is there anyway to prevent this from happening? I simply want a way to view html content without the user being able to manipulate any of the content.

Any help is appreciated.

Thanks!
Ian

1 Answer, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 09 May 2013, 01:39 PM
Hi Ian,

As far as we are aware, when IsReadOnly is set to true and IsSelectionEnabled - to false, the only elements that can be moved are tables when selected with the table adorner. 

You can work around this by removing the UI layer responsible for table movement like this:
public MainPage()
{
    InitializeComponent();
    this.editor.UILayersBuilder = new MyCustomUILayerBuilder();
}
    
class MyCustomUILayerBuilder : UILayersBuilder
{
    protected override void BuildUILayersOverride(IUILayerContainer uiLayerContainer)
    {
        base.BuildUILayersOverride(uiLayerContainer);
        uiLayerContainer.UILayers.Remove(DefaultUILayers.TableMovementLayer);
    }
}

I hope this helps! If you are observing different results on your end or are having other difficulties, please let us know.
 
Regards,
Petya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RichTextBox
Asked by
ITLackey
Top achievements
Rank 1
Answers by
Petya
Telerik team
Share this question
or