We are experiencing a weird issue using UltraWinSpellChecker (v2016, vol 2). A spelling error is displayed in our UltraTextEditor and when you right-click and chose "Ignore Word" from the context menu, an ArgumentException is raised. Here are some of the details (note this is on a closed network so I am hand-typing the info below, we can't cut-and-paste).
<System.ArgumentException><message>The word specified must be a single wordParameter name: word</message><source>Infragistics4.Win.UltraSpellChecker.v.16.2</source><targetsite>EnsureTextIsSingleWord</targetsite><stacktrace><frame>Infragistics.Win.UltraWinSpellChecker.UltraSpellChecker.EnsureTextIsSingleWord(String text, String argumentName)</frame><frame>Infragistics.Win.UltraWinSpellChecker.UltraSpellChecker.AddWordToUserDictionary(String word)</frame><frame>References to my code here...
Any idea what might be going on? Here's the text with the red underline that I right-clicked on:
"C&P values to reflect current NGES"
TIA... Steve
Hi Steve,
It's been a while since I've played around with the Spellchecker, but I spent some time looking at it this morning, and I can't find any built-in "Ignore Word" context menu.
There are "Ignore Once" and "Ignore All" options in the spellchecker dialog.
Using the same text you posted here, I tried both of those buttons out in a range of versions for the assemblies from 15.2 up to 18.1 and couldn't get any exceptions to occur. The only work in that sentence that comes up as a spelling error is "NGES".
Assuming you are creating your own context menu and calling into the IgnoreAll method on the SpellChecker component, I was able to get that exception to occur if I explicitly pass in a string with more than one word. So, for example, I get the same exception if I run code like this:
this.ultraSpellChecker1.IgnoreAll("one two");
But this code works fine:
this.ultraSpellChecker1.IgnoreAll("NGES");
So my best guess here is that you have created your own context menu and you are passing in a string that has more than one word in it, and you need to have your code check for that. Maybe you are simply passing in the Selected text and not validating that the text isn't a single word?
It turns out there was a non-breaking space in the text which was throwing a bit of custom code for a loop. it was seeing what appeared to be multiple words as a single word and passing it to IgnoreAll. Thus the exception. Thanks for leading me in the right direction!
I'm glad you got it all sorted out. :)