Knowledgebase Home Page  >  RapidSpell Web ASP.NET  >  Behavior Customization
Search the Knowledge Base
How can I limit the number of suggestions with RapidSpellWInline? (C#)
https://keyoti.com/kb/Default.aspx?ToDo=view&questId=176&catId=55

Options

Print this page
Email this to a friend
To limit the number of suggestions shown in the popup menu, subclass the RapidSpellChecker and override the FindSuggestions method.
 
1. Add this class to the project
 

class CustomChecker : Keyoti.RapidSpell.RapidSpellChecker

{

    public CustomChecker(string license) : base(license) { }

    protected override ArrayList FindSuggestions(string word, bool searchLowerCase)

    {

        ArrayList s = base.FindSuggestions(word, searchLowerCase);

        if (s.Count > 2)

            s.RemoveRange(2, s.Count - 2);

        return s;

    }

}

 

2. Use the class from the code-behind of the RapidSpellWInlineHelper page

private void Page_Load(object sender, System.EventArgs e)

{

    // a time trial key

    string license = "5752675E645A665F68596A69615A6638383C414238423A403C4241424B41464A4F503";

    RapidSpellWInlineHelper1.CheckerEngine = new CustomChecker(license);

}

 

That's it, the number of suggestions in this case will be limited to 2.

 

 


Related Questions:

Attachments:

No attachments were found.