Hello, we are using a RadRichTextBox with SpellChecker dialog. When a word is added to the custom dictionary, either through the context menu or the SpellChecker dialog, the AddWord event is fired correctly. However, when a word is deleted from the dialog, or the Delete All is selected, no event is fired. We are capturing both RemoveWord and DataChanged events, but they are not called. Our current version of controls may be older, so if this was fixed in a later version, please indicate that so we can proceed accordingly.
Thanks for your help.
5 Answers, 1 is accepted
I tried the mentioned scenario with the latest version of our controls and DataChanged was successfully fired. I am attaching to the event as followed:
radRichTextBox.SpellChecker.GetCustomDictionary().DataChanged += RtbComments_DataChanged;
Regards,
Peshito
Telerik by Progress
Thank you, that was helpful. We were capturing the DataChanged event from the spell checker, not the dictionary. We changed:
radRichTextBox.SpellChecker.DataChanged += RtbComments_DataChanged;
to
radRichTextBox.SpellChecker.GetCustomDictionary().DataChanged += RtbComments_DataChanged;
Now, the DataChanged event is firing when removing a word, or deleting all entries from the custom dictionary.
I have a follow-on question: Is there an easy way to tell what happened in the DataChanged event? It seems the EventArgs are always empty, and the only way I can tell to see what changed is to somehow inspect the Words collection in the sender object. It would be helpful to know if one word was changed, or the collection was emptied.
Thanks again for your help,
Bob
I found the answer to the refresh problem:
radRichTextBox.InvalidateProofingErrors(false);
I am glad you managed to find the answer to the refresh issue.
As for the question about the DataChanged event, this is the default behavior. You could either use the approach you have suggested by inspecting the Words collection or another approach would be to use a CustomDictionary. This CustomDictionary should implement ICustomWordDictionary and you could add the functionality you need there.
Hope this helps.
Regards,
Peshito
Telerik by Progress