The DeepCopy method does not copy the font of the predefined table styles
Workaround:
var fragment = new DocumentFragment(radRichTextBox.Document);
radRichTextBox.Document = new RadDocument();
DefaultStyleSheet.Instance.ApplyStylesheetToDocument(radRichTextBox.Document);
radRichTextBox.InsertFragment(fragment);
Here we are:
HtmlFormatProvider htmlProvider = new HtmlFormatProvider();
htmlProvider.ExportSettings.StylesExportMode = StylesExportMode.Inline;
string _html =
@"
<html>
<head>
<meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"">
</head>
<body>
<div name=""divtagdefaultwrapper"" style=""font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0"">
<div class=""WordSection1"">
<p class=""MsoNormal"" style=""text-autospace:none"">
<span style=""font-size:11pt; color:rgb(31,73,125)"">
I am out of office, please contact Aaaaaa Bbbbbbb (Tel: +1-234-567-8900/email:
<a href=""mailto:aaaaaa.bbbbbb@zzz.com"">aaaaaa.bbbbbb@zzz.com</a>) for assistance
</span>
</p>
</div>
</div>
</body>
</html>
";
RadDocument _doc = htmlProvider.Import(_html);
radRichTextBox.Document = _doc;
And here is an exception:
System.NullReferenceException
htmlString = htmlString.Replace("<p>", string.Empty).Replace("</p>", string.Empty);
In a specific scenario when there are many tables in a document the following case leads to NullReferenceException.
- Select few tables
- while mouse is still selecting tables use keyboard's Ctrl + A
- Leave the mouse
- use Ctrl + A again (this time everything is selected)
- hit Delete
- Object reference not set to an instance of an object is thrown
This functionality is supported by MS Word:
A possible workaround could be to enclose the RadSpreadsheet as a UI element. More information could be found in the InlineUIContainer help article.
Hello,
We found a problem when using the radrichtextbox control. When radrichtextbox is enabled to cancel input, error will be reported using the sougou Chinese input method. This problem will not occur in the English input method. Please help solve it. Thank you very much.
private void radRichTextBox_CommandExecuted(object sender, CommandExecutedEventArgs e)
{
if (e.Command is DeleteCommand && imageToDelete!=null)
{
this.radRichTextBox.Document.Selection.Clear();
this.radRichTextBox.Document.Selection.AddDocumentElementToSelection(imageToDelete);
this.radRichTextBox.Delete(true);
this.imageToDelete = null;
}
}
private ImageInline imageToDelete;
void radRichTextBox_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
{
if (e.Command is DeleteCommand)
{
var selectedBoxes = this.radRichTextBox.Document.Selection.GetSelectedBoxes().ToList();
if (selectedBoxes.Count() == 2 && selectedBoxes[0].AssociatedInline is FieldRangeStart && selectedBoxes[1].AssociatedInline is ImageInline)
{
imageToDelete = selectedBoxes[1].AssociatedInline as ImageInline;
}
}
}
While typing in RadRichtextBox using Korean (Microsoft IME) keyboard "space" or "Enter" repeats the last typed character.
Workaround: Create a custom caret (example for custom caret) and override the EnableAsynchronousTextInsertion property so you can set it to false.