When inserting text (document fragment) next to a correctly spelled word they get both underlined as incorrect.
Currently when the text contains consecutive non-space symbols like "~!@#$%^&*()_+=-`[]{};:'"/\|., ", each character is detected as a separate word. Instead, they should be considered one word, including all the subsequent space characters.
The following functionalities should respect this grouping:
- Caret navigation by words (CTRL + left/right arrow), MoveCaret UI command and the corresponding DocumentPosition methods.
- Selecting word by double clicking.
'Decrement paragraph left indent' command can set negative left indent which makes bullets/numbering of a list clipped. Instead, it shouldn't be executed if the bullets/numbering would become invisible.
Workaround: Cancel the command in CommandExecuting event:
this.radRichTextBox.CommandExecuting += (sender, e) =>
{
if (e.Command == this.radRichTextBox.Commands.DecrementParagraphLeftIndentCommand)
{
if (this.radRichTextBox.Document.Selection.GetSelectedParagraphs().Any(p => p.IsInList && p.LeftIndent <= 24))
{
e.Cancel = true;
}
}
};
The spacing between the letters is too big.
The built-in Hyperlink style is not applied to hyperlinks imported from HTML (<a> tag). As a result, the hyperlinks in the document do not have the blue underline.
Workaround: Subscribe for the SetupDocument event of the HtmlDataProvider and set the hyperlinks' style manually.
private void HtmlDataProvider_SetupDocument(object sender, Telerik.Windows.Documents.FormatProviders.SetupDocumentEventArgs e)
{
StyleDefinition hyperLinkStyle = e.Document.StyleRepository[RadDocumentDefaultStyles.HyperlinkStyleName];
hyperLinkStyle.SpanProperties.ForeColor = Colors.Green;//Color.FromRgb(0xff, 0x7a, 0xcc);
var hyperlinks = e.Document.EnumerateChildrenOfType<HyperlinkRangeStart>();
RadDocumentEditor editor = new RadDocumentEditor(e.Document);
editor.Document.History.IsEnabled = false;
foreach (HyperlinkRangeStart hyperlink in hyperlinks)
{
e.Document.Selection.SelectAnnotationRange(hyperlink);
editor.ChangeStyleName(RadDocumentDefaultStyles.HyperlinkStyleName);
}
e.Document.Selection.Clear();
editor.Document.History.IsEnabled = true;
}
When RadRichTextBox.DocumentInheritsDefaultStyleSettings is set to true, lists in the document are exported to HTML with Verdana font, instead of with the font applied in the UI.
Workaround: Use modification of the document default styles ("Normal") instead of setting DocumentInheritsDefaultStyleSettings to true, e.g.:
this.radRichTextBox.Document.StyleRepository["Normal"].SpanProperties.FontFamily = new FontFamily("Segoe UI");
When a DropDownList SDT form is saved in a XAML document and then imported with the XamlFormatProvider, an extra ListItem entry is added in the items collection of the DropDownList. The extra entry is the default "Choose an item".
To work this around, iterate all ComboBoxProperties and manually remove duplicates of the "Choose an item" entry.
var dropDownLists = radRichTextBox.Document.EnumerateChildrenOfType<SdtRangeStart>()
.Where(x => x.SdtProperties is ComboBoxProperties)
.Select(x => x.SdtProperties).OfType<ComboBoxProperties>();
var defaultItemString = LocalizationManager.GetString("Documents_ContentControlsGenerator_ListItem");
foreach (var item in dropDownLists)
{
if (item.Items.Count > 0 && item.Items.Any(x => x.Value != defaultItemString) && item.Items.Any(x => x.Value == defaultItemString))
{
var occurrence = item.Items.FirstOrDefault(x => x.Value == defaultItemString);
while (occurrence != null)
{
item.Items.Remove(occurrence);
occurrence = item.Items.FirstOrDefault(x => x.Value == defaultItemString);
}
}
}
If the document contains a simple field without run inside, the import process fails.
<w:fldSimple w:instr="page" w:dirty="true"/>
The same document with a run inside the field does not cause an error
<w:fldSimple w:instr="page" w:dirty="true">
<w:r>
<w:t>1</w:t>
</w:r>
</w:fldSimple>
The TableCellProperty.Padding property of the "TableNormal" StyleDefinition doesn't take effect in the UI. The same is valid for the TableProperties.CellPadding property.
To work this around, you can manually set the Padding property of all TableCell elements in the RadDocument.
var cells = radDocument.EnumerateChildrenOfType<Telerik.Windows.Documents.Model.TableCell>();
foreach (var cell in cells)
{
cell.Padding = new Padding(10);
}
Implement the export of notes (footnote, endnote) in the PdfFormatProvider of the RadRichTextBox.