Highlight words which are incorrect

4 posts, 0 answers
  1. Todd Millett
    Todd Millett avatar
    115 posts
    Member since:
    Jul 2009

    Posted 15 Apr 2011 Link to this post

    Instead of showing the Window of spell checking, is there a way in which we can highlight only the incorrect words inside the textbox, same as can be done in the RichTextBox? With RichTextBox the only problem is that we cannot prevent the user from entering multiline.
  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 18 Apr 2011 Link to this post

    Hello Todd Millett,

    You are right that it would be great if it was possible to have the underlines in the MS controls. However, it is not possible for us to implement highlighting or underlining of incorrect words in a TextBox or a RichTextBox, as they do not provide an API for that.
    On the other hand, the behavior of RadRichTextBox on pasting multi-paragraph text when AcceptsReturn = "False" has already been fixed and that will be visible once an interim build is released.

    Kind regards,
    Iva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Todd Millett
    Todd Millett avatar
    115 posts
    Member since:
    Jul 2009

    Posted 19 Apr 2011 Link to this post

    Also is it possible to get suggestions for a word without calling the RadSpellChecker.Check(...) method ? Like explicitly go and check a word in the dictionary and get the suggested list of words ?
  5. Andrew
    Admin
    Andrew avatar
    140 posts

    Posted 20 Apr 2011 Link to this post

    Hi Todd Millett,

    Yes, you can do this. Use the following code to get an instance of the DocumentSpellChecker for the corresponding control.

    IControlSpellChecker controlSpellchecker = ControlSpellCheckersManager.GetControlSpellChecker(typeof(TextBox));
    ISpellChecker spellChecker = controlSpellchecker.SpellChecker;
    DocumentSpellChecker documentSpellChecker = (DocumentSpellChecker)spellChecker;
    After that, just invoke the GetSuggestions(string word) method of that instance, which returns a generic collection of type ICollection<string>.

    Contact  us if you happen to have any other difficulties.

    Best wishes,
    Andrew
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top