Declined
Last Updated: 08 Jun 2017 06:47 by ADMIN
Iva
Created on: 07 Jan 2011 11:24
Category: RichTextBox
Type: Bug Report
0
Non-breaking spaces are not regarded as separators between words and interfere with spell checking
The spellchecker does not recognize words with non-breaking spaces between them as separate.
A workaround when pasting text into the RadRichTextBox is to subscribe to the CommandExecuting event of the control, get the paste text from the clipboard and replace all non-brekaing spaces with spaces.

private void editor_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
        {
            if (e.Command is PasteCommand)
            {
                var pasteText = Clipboard.GetDataObject().GetData("HTML Format") as string;
                if (pasteText != null)
                {
                    pasteText=  pasteText.Replace("&nbsp", " ").Replace(' ',' ');
                    var originalDataObject = Clipboard.GetDataObject();
                    DataObject dataObject = new DataObject();
                    foreach (string format in originalDataObject.GetFormats())
                    {
                        dataObject.SetData(format, originalDataObject.GetData(format));
                    }
                    dataObject.SetData("HTML Format", pasteText);
                    Clipboard.SetDataObject(dataObject);
                }               
            }
        }
1 comment
ADMIN
Boby
Posted on: 08 Jun 2017 06:45
The item is declined as duplicate of more generic item:
http://feedback.telerik.com/Project/143/Feedback/Details/218873
Existing votes and followers are already migrated there. Please use the new item instead of this one.

The workaround is still relevant for this particular scenario.