or
private void SetMergeFieldReadOnly(MergeField field, RadRichTextBox richTextBox, bool isReadonly) { var fieldEnd = richTextBox.Document.EnumerateChildrenOfType<FieldRangeEnd>() .FirstOrDefault(fs => (fs.FieldRangeStart.Field is MergeField) && (((MergeField)fs.FieldRangeStart.Field).PropertyPath == field.PropertyPath)); if (fieldEnd != null) { var fieldStart = fieldEnd.FieldRangeStart; var posFieldStart = new DocumentPosition(richTextBox.Document); var posFieldEnd = new DocumentPosition(richTextBox.Document); posFieldStart.MoveToInline(fieldStart); posFieldEnd.MoveToInline(fieldEnd); if (isReadonly) // add readonlyrange { richTextBox.Document.Selection.Clear(); richTextBox.Document.Selection.SetSelectionStart(posFieldStart); richTextBox.Document.Selection.AddSelectionEnd(posFieldEnd); richTextBox.InsertReadOnlyRange(); } else // remove readonlyrange { // 1st method - doesn't work. //richTextBox.Document.Selection.Clear(); //richTextBox.Document.Selection.SetSelectionStart(posDebField); //richTextBox.Document.Selection.AddSelectionEnd(posFinField); //richTextBox.DeleteReadOnlyRange(); // <-- no error but the field is still readonly after that. // 2nd method - works but not properly var readOnlyRangeStarts = richTextBox.Document.EnumerateChildrenOfType<ReadOnlyRangeStart>(); var posDebReadOnly = new DocumentPosition(richTextBox.Document); var posFinReadOnly = new DocumentPosition(richTextBox.Document); foreach (var readOnlyRangeStart in readOnlyRangeStarts) { if (readOnlyRangeStart.End != null) { posDebReadOnly.MoveToInline(readOnlyRangeStart); posFinReadOnly.MoveToInline(readOnlyRangeStart.End); if ((posFinReadOnly >= posFieldStart) && (posDebReadOnly <= posFieldEnd)) { richTextBox.DeleteReadOnlyRange(readOnlyRangeStart); // remove the protection on ALL the readonly range !!! } } } } } }Hello Telerik team,
I’m having trouble with hosting an Addin UI in RadDock.
I wrote a demo to reproduce this issue. download demo here
You can see if you unpin the RadPane, you will no longer be able to focus the textbox. I’m wondering if this is a known issue and is there any workaround for this?
I have read this (http://www.telerik.com/community/forums/wpf/docking/wpf-frame-control-not-visible-in-floating-window.aspx) and this (http://www.telerik.com/community/forums/wpf/docking/radpane-not-displaying-webbrowser-content-while-floating.aspx) threads to make the UI display in RadPane. But when RadPane is in unpinned state, the UI inside it is not able to be used. When I click it, the RadPane automatically hides.