Click event are not raised, and the command in the Command property is not executed, when a Button is placed inside InlineUIContainer, and is tapped on a touch device. Workaround: One way to work around this is by setting TouchManager.TouchMode of the button to None, which will exclude the button from the TouchManager and will let the .NET events reach it. The other is to use the TouchManager Tap event instead of Command or Click.
Making headers and footers read-only or invisible is possible, but there is no way to prevent focusing them.
The crash is reproduced with a document with an image in the header and two columns in the body of the document.
Importing a document containing non-printable characters and other invalid for XML characters is possible. However, trying to export the same to XAML or DOCX causes System.ArgumentException raised by the XmlWriter. Workaround: Preprocess the input file and remove any characters not allowed in XML. Fix available in LIB Version 2018.3.1029.
Workaround is to use the Classes StylesExportMode.
Applying a list does not follow the specified indention of texts. When a paragraph has previously applied indentation, it should be preserved and added to the indentation of the bullet. In RadRichTextBox, the indentation of the paragraphs is not respected when applying a list style to it - only the setting of the list is applied.
When the tag \sl (line spacing) has value 0, according to the specification it should be calculated according to the highest character in the line, which corresponds to the LineSpacingType single. Instead, in RTB this text disappears.
Workaround:
private void RadRichTextBox_DocumentChanged(object sender, EventArgs e)
{
foreach (var paragraph in this.radRichTextBox.Document.EnumerateChildrenOfType<Paragraph>())
{
if (paragraph.LineSpacing == 0)
{
paragraph.LineSpacing = 1;
}
}
}
Fix available in LIB Version 2017.3.1211.
NullReferenceException is thrown when some of the parts in the template of SelectionMiniToolBar are missing, e.g. bold button, italic button, etc.; and selected text properties are changed while the selection mini tool bar is still opened, for example by clicking buttons in the ribbon UI. Available in LIB Version 2017.3.1225.
In MS Word, the users can change the alignment of a table using the buttons related to Paragraph alignment. To do that, the whole table must be selected.
In RadRichTextBox, selecting a Table and pressing one of the buttons, let say for Right alignment, leads to aligning the content of the table and not the table itself.
Workaround:
private void RadRichTextBox_CommandExecuting(object sender, CommandExecutingEventArgs e)
{
if (e.Command is ChangeTextAlignmentCommand &&
this.radRichTextBox.Document.Selection.Ranges.Count == 1 &&
this.radRichTextBox.Document.Selection.Ranges.First.RangeType == SelectionRangeType.Table &&
e.CommandParameter.ToString() != "Justify")
{
e.Cancel = true;
RadDocumentEditor editor = new RadDocumentEditor(this.radRichTextBox.Document);
RadHorizontalAlignment newAlignment = (RadHorizontalAlignment) Enum.Parse(typeof(RadHorizontalAlignment), e.CommandParameter.ToString());
editor.ChangeTableHorizontalAlignment(newAlignment);
}
}
NOTE: With this approach, the toggle buttons in the UI are not updated properly and this should be additionally handled.
Tapping on a selected region in a document should show the selection mini toolbar. A second tap should clear the selection and then place the cursor on the tapped location, but this does not happen. Subsequent tap should select the entire word and another tap should select the paragraph.
When applying a table style, the previously applied local properties to a table or cell should be cleared and the ones defined by the style should be used.
Workaround: Create a new Table and apply the style to it; then copy the properties to the existing table in the document
private void RadRichTextBox_CommandExecuting(object sender, CommandExecutingEventArgs e)
{
if (e.Command is ChangeStyleNameCommand && this.radRichTextBox.Document.CaretPosition.IsPositionInsideTable)
{
StyleDefinition style = this.radRichTextBox.Document.StyleRepository.GetValueOrNull(e.CommandParameter.ToString());
if (style.Type == StyleType.Table)
{
Table currentTable = this.radRichTextBox.Document.CaretPosition.GetCurrentTableBox().AssociatedTable;
currentTable.Borders = new TableBorders(style.TableProperties.Borders);
Table tableWithStyle = new Table(currentTable.Rows.Count, currentTable.Rows.First.Cells.Count);
tableWithStyle.Style = this.radRichTextBox.Document.StyleRepository.GetValueOrNull(e.CommandParameter.ToString());
for (int rowIndex = 0; rowIndex < currentTable.Rows.Count; rowIndex++)
{
for (int columnIndex = 0; columnIndex < currentTable.Rows.First.Cells.Count; columnIndex++)
{
TableCell cell = currentTable.Rows.Skip(rowIndex).First().Cells.Skip(columnIndex).First();
TableCell cellWithStyle = tableWithStyle.Rows.Skip(rowIndex).First().Cells.Skip(columnIndex).First();
cell.Background = cellWithStyle.Background;
cell.Borders = cellWithStyle.Borders;
}
}
this.radRichTextBox.UpdateEditorLayout();
e.Cancel = true;
}
}
}
NullReferenceException is thrown when documents are exported to PDF using PdfFormatProvider in multiple threads. Available in R1 2018 Official Release Version.
The \sl (line spacing) RTF tag is supposed to be accompanied by a number indicating the value of the line spacing. According to the RTF specification: Space between lines. If this control word is missing or if \sl0 is used, the line spacing is automatically determined by the tallest character in the line. If N is a positive value, this size is used only if it is taller than the tallest character (otherwise, the tallest character is used); if N is a negative value, the absolute value of N is used, even if it is shorter than the tallest character. However, there are documents where the number is missing at all and MS Word interprets those as if the value is 0. RadRichTextBox visualizes these with lines of size close to zero which makes them invisible. Although this case is not mentioned in the specification, we can consider fixing it.
When cross-reference is added in the header/footer of a document in does not show the available options from the document. XAML team reviewed this item and noted that it duplicates with another one. Please use the item below in order to track the status of this request. https://feedback.telerik.com/Project/143/Feedback/Details/210419-richtextbox-add-functionality-to-work-with-cross-references-and-hyperlinks-to-bo
When an element refers to a style name of a style that is not present in the document, trying to export it with RtfFormatProvider leads to KeyNotFoundException. A similar document could be produced when copying content from MS Word. The same case is working properly with the other providers as well as in WordsProcessing (check the related 133762). Workaround: Check all the styles used in the document and remove the NextStyleName or LinkedStyle values that point to non-existing in the document styles. Available in LIB Version 2018.1.212.
Pressing Delete at the end of a paragraph leads to merging the content of the current paragraph with the next block. However, when the deleted paragraph contains a single space, the layout stops updating after pressing Delete.
Steps to reproduce:
1. Create two tables with paragraph between them
2. Add a space to the paragraph
3. Press Delete (when the caret is just after the space)
Observed: The layout is not updated after this and further modifications
Workaround:
Delete the space before deleting the paragraph:
private void RadRichTextBox_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
{
if (e.Command is DeleteCommand && this.radRichTextBox.Document.Selection.IsEmpty)
{
Paragraph currentParagraph = this.radRichTextBox.Document.CaretPosition.GetCurrentParagraphBox().AssociatedParagraph;
if (currentParagraph.Inlines.Count==1 && string.IsNullOrWhiteSpace((currentParagraph.Inlines.First as Span).Text))
{
this.radRichTextBox.Delete(true);
}
}
}
Currently, the underline is always exported as single. Add support for the other types that can be used in RadRichTextBox.
When the width of the tab stop is set to a negative value, an ArgumentOutOfRangeException is thrown on import. Other applications handle this case and convert the value to a positive number. Fix is available in LIB Version 2018.1.326.
A specific combination of document elements causes an infinite measure loop.
An additional line should be inserted between the inner div and the span where the first <br> is inserted.