To reproduce:
Open TelerikEditor and underline the whole text. Go to the end of a line and hold space. You will notice that the empty spaces are being underlined. The behavior is not the same as in Word.
Workaround:
Remove the underlining of the empty spaces at the end of the lines:
void Button_Click(object sender, EventArgs e)
{
var caret = this.richTextBox.Document.CaretPosition;
var originalPosition = new DocumentPosition(caret);
caret.MoveToFirstPositionInDocument();
do
{
caret.MoveToCurrentLineEnd();
var endPos = new DocumentPosition(caret);
caret.MoveToCurrentWordStart();
caret.MoveToCurrentWordEnd();
var startPos = new DocumentPosition(caret);
this.richTextBox.Document.Selection.AddSelectionStart(startPos);
this.richTextBox.Document.Selection.AddSelectionEnd(endPos);
this.richTextBox.ChangeUnderlineDecoration(UnderlineType.None);
this.richTextBox.Document.Selection.Clear();
caret.MoveToCurrentLineEnd();
}
while (caret.MoveToNext());
caret.MoveToPosition(originalPosition);
}
Beware that this workaround will not work in all cases. It should be used only prior to exporting or similar cases