Spell checker in C1Richtext for Out of Broswer

Posted by: jaiswalshilpi43 on 26 April 2018, 8:51 pm EST

    • Post Options:
    • Link

    Posted 26 April 2018, 8:51 pm EST

    n C1richtextbox` control, I need to add spell checker in my Silverlight(out of browser) application. Spell checker works fine with the application but it does not work for Out of Browser application.

    I have added references to C1.Silverlight and C1.Silverlight.Spellchecker & “C1Spell_en-US.dct” is also added properly & .dct file I also checked its working fine in the browser.

    Please suggest what should I do to get spell checker work in Out of Browser application.

    SpellChecker.MainDictionary.LoadAsync(“C1Spell_en-US.dct”)

  • Posted 1 May 2018, 12:22 am EST

    Hello,

    What Silverlight version and ComponentOne version are you using?

    Thanks,

    Ruchir Agarwal

  • Posted 1 May 2018, 5:23 pm EST

    Hi Ruchir,

    Thanks for reply I’m using 5.0.20173.576 version & Silverlight 5.0

    (C1.Silverlight.SpellChecker.5)

  • Posted 2 May 2018, 10:48 pm EST

    Hi Ruchir,

    I also try to get that dictionary from “IsolatedStorage” but i dont know to read for spellchecker. Below code I’m using it,Below code i’m using it

        Const Spelldictnry = "C1Spell_en-US.dct"
          If iso.FileExists(Spelldictnry) Then
                isoStream = New 
             IsolatedStorage.IsolatedStorageFileStream(Spelldictnry, FileMode.Open, iso)
                Dim sr As New System.IO.StreamReader(isoStream)
                Dim str As String = sr.ReadLine.ToString()
                Dim reader As TextReader = New StringReader(str)
                '  spell.MainDictionary.ReadXmlFromString(str)
            End If
    
  • Posted 3 May 2018, 12:41 am EST

    Hi,

    I am discussing it with the development team and will let you know once I receive some information from them [ID: 320095].

    Regards,

  • Posted 6 May 2018, 10:38 pm EST

    Hello Shilpi,

    Regarding the out-of-browser application, please use spell.MainDictionary.Load(Stream stream) method instead.

    #1. Add C1Spell_en-US.dct as “Embedded Resource” in Silverllight application.

    #2. Add GetDctFileIndex method.```

    Private Function GetDctFileIndex(resoucesNames As String()) As Integer

    Dim i As Integer = 0

    While i < resoucesNames.Length

    If resoucesNames(i).Contains(“C1Spell_en-US.dct”) Then

    Return i

    End If

    i += 1

    End While

    Return -1

    End Function

     #3. Add the following codes:


    Dim spell = New C1SpellChecker()

    rtb.SpellChecker = spell

    Dim assembly As Assembly = Assembly.GetExecutingAssembly()

    Dim resoucesNames As String() = assembly.GetManifestResourceNames()

    Dim index As Integer = GetDctFileIndex(resoucesNames)

    If index >= 0 Then

    Dim fileStream As Stream = assembly.GetManifestResourceStream(resoucesNames(index))

    If fileStream.Length > 0 Then

    spell.MainDictionary.Load(fileStream)

    End If

    End If

    Thanks,
  • Posted 7 May 2018, 6:44 pm EST

    HiRuchir,

    Its working :slight_smile: :slight_smile: thanks a lot

  • Posted 8 May 2018, 5:44 pm EST

    Hi Ruchir,

    Thanks for help.

    Can you also provide how we can add words to the custom dictionary

    while spell-checking by clicking the “Add” button in the spell dialog box.

  • Posted 9 May 2018, 4:03 pm EST

    Glad that I could help!

    You can add words to UserDictionary, not CustomDictionary. using AddWord method http://help.grapecity.com/componentone/NetHelp/C1SpellCheckerWPF/webframe.html#C1.Silverlight.SpellChecker.5~C1.Silverlight.SpellChecker.UserDictionary~AddWord.html

    If you are having any sort of doubt, I suggest you to refer the following forum post that discusses the same concern in detail, though it is for WinForms platform, it still holds good for Silverlight /WPF: https://www.grapecity.com/en/forums/winforms-edition/spellcheck-custom-dictiona

    Hopefully this will clarify.

    Regards,

    Ruchir Agarwal

  • Posted 10 May 2018, 12:50 am EST

    Hi Ruchir,

    I go through that link, is that any way we can “Add” word to user Dictionary programmatically? or is that any way when we right click on C1Richtextbox by clicking the “Add” button in the spell dialog box will add it to user Dictionary directly?

    Please provide me some sample data.

    here we are doing it manually.

    C1SpellChecker.UserDictionary.AddWord(“Test”)

    Thanks

  • Posted 10 May 2018, 7:38 pm EST - Updated 3 October 2022, 10:55 pm EST

    Hello,

    To the extent I understand you wish to incorporate C1SpellChecker in C1RichTextbox and have the functionality of adding any word to the dictionary at run time, by right clicking on the word, selecting Add option, as shown below:



    Then I would like to inform you that for this you may refer to the product sample ‘RichTextBoxSamples’ installed at \Documents\ComponentOne Samples\Silverlight\C1.Silverlight.RichTextBox\CS

    Thanks,

    Ruchir

  • Posted 11 May 2018, 1:08 am EST

  • Posted 11 May 2018, 1:13 am EST

  • Posted 13 May 2018, 6:11 pm EST

    Hello,

    I could not interpret what you meant by quoting the replies and sharing the link, do want to ask something or is it that those replies helped you?

    Request you to please elaborate here.

    Thanks,

    Ruchir

  • Posted 10 June 2018, 9:37 pm EST - Updated 3 October 2022, 10:55 pm EST

    Hi Ruchir,

    Can you please help me regarding adding a word to userDictionary.I’m using 5.0.20173.576 version & Silverlight 5.0 (C1.Silverlight.SpellChecker.5). I tried below code but when i do right click on richtextbox unable to see the word which i’m adding in code. please find the attached image.

    C1SpellChecker.UserDictionary.AddWord(“Daktro”)

    Thanks

  • Posted 11 June 2018, 9:06 pm EST

    Hello Shilpi,

    The code you are using is correct for adding words to dictionary.

    To check the issue, could you please share whether you are able to see the added word “Daktro” in suggestions on entering “Daktr” ?

    If you are able to see the word in suggestions, then I would like to know from what level do you want to show “Daktro” in suggestions list. Like, would you like to show this word when “Daktr”/ “Dakt”/ “Dak” is entered etc

    However, if you are not able to observe the added word in suggestion, please share your application, since I am able to observe the word added properly in suggestions list upon entering “Daktr”, using the same version as yours.

    Thanks,

    Ruchir

  • Posted 13 June 2018, 6:33 pm EST

    Hello Ruchir,

    Thanks for reply when i typed “Daktros” then only it suggesting the word “Daktro”. I want it to suggest when i type “DAK”.

    For instance right now I’m hardcoding some words but I’m not sure how may words have to add,Is that any procedure to add words to the global dictionary on the server side??

    Thanks

  • Posted 13 June 2018, 11:09 pm EST

    I have shared your requirement with the development team[TFS: 327438] and will let you know, once we receive an update from them.

    Thanks,

    Ruchir

  • Posted 14 June 2018, 4:22 pm EST

    Thanks for your help :slight_smile:

  • Posted 12 February 2020, 4:57 pm EST

    Hello,

    I regret to inform you that now only critical bug fixes would be done in Silverlight.

    *Note: The issue does not exist in C1RichTextBox for WPF edition.

    ~Ruchir

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels