This is a migrated thread and some comments may be shown as answers.

SpellChecker.DataChanged += is not working anymore

9 Answers 100 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
danparker276
Top achievements
Rank 2
danparker276 asked on 02 Feb 2012, 08:28 PM
My code that used to work to fire an event when the spell checker is changed (like a word added to the dictionary), isn't working anymore.

  this.rrtbDescription.SpellChecker.DataChanged += SpellChecker_DataChanged;

My method SpellChecker_DataChanged doesn't get called.
Is this a silverlight 5 thing?  I'm using the silverlight 5 binaries 2011.3.1304.1050
Edit: it's ok on a sample program I made.  I'm doing a lot of different stuff in my program, seems like I'm killing the functionality somehow, I'll look into it more.

9 Answers, 1 is accepted

Sort by
0
danparker276
Top achievements
Rank 2
answered on 02 Feb 2012, 09:49 PM
Ok, this happens after I load a dictionary.  The DataChanged event won't get fired if I use the (AddDictionary) like below.

EDIT: If it helps, I call the event because I want to add new words to the database instead of isolated storage.  In the thread below, you say there is a better way to do this.  what is the other way?
http://www.telerik.com/community/forums/silverlight/richtextbox/spell-checker-adding-words-to-database-instead-of-iso-for-custom.aspx

RadDictionary rd = new RadDictionary();
try
{
 
        string filename = "/RichText;component/en-US.tdf";
        Stream tdfStream = Application.GetResourceStream(new Uri(filename, UriKind.Relative)).Stream;
 
        rd.Load(tdfStream);
 
}
catch
{
 
}
((DocumentSpellChecker)this.rrtbDescription2.SpellChecker).AddDictionary(rd, CultureInfo.InvariantCulture);
 // The line above kills the dataChanged event
 
this.rrtbDescription2.SpellChecker.DataChanged += new EventHandler(SpellChecker_DataChanged);
0
Accepted
Andrew
Telerik team
answered on 06 Feb 2012, 04:54 PM
Hello Dan,

Actually this is a bug. We will fix it in our upcoming release, which will be out in a few weeks.
The workaround would be to attach the event to the custom dictionary to which the words are added like this:

((DocumentSpellChecker)this.editor.SpellChecker).GetCustomDictionary().DataChanged += new EventHandler(SpellChecker_DataChanged);

We have updated your Telerik points in appreciation of your involvement. Do not hesitate to get back to us if you have any other problems.

Note: Once the release is out and you upgrade to 2012 Q1, you should remove the line above. Greetings,
Andrew
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
danparker276
Top achievements
Rank 2
answered on 06 Feb 2012, 09:21 PM
Thanks it working now.  One thing I noticed though is that when I add it to the dictionary the redline under the word just added doesn't go away unless I set my cursor on another textbox  or input control.
EDIT: the redline seems to go away now, I've noticed some strange behavior with that which I can't repeat though.
0
Iva Toteva
Telerik team
answered on 08 Feb 2012, 05:44 PM
Hello Dan,

We would appreciate it if you manage to reproduce the issue and get back to us with repro steps whenever you get back to the issue.

Kind regards,
Iva Toteva
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
danparker276
Top achievements
Rank 2
answered on 17 Feb 2012, 11:44 PM
On one of my clients a few users were not getting the red underline but if you right click it will show that it's a misspelled word.  This doesn't happen all the time though, and I couldn't really repeat this.  I also don't see it on my local system.

I'm in the middle of switching to the Silverlight 5 Q1 2012.  Maybe this will clear up after that.
0
danparker276
Top achievements
Rank 2
answered on 28 Feb 2012, 02:32 AM
I added a support ticket with an attachment because I was able to re-produce this now.

This happens when I have 2 child windows and switch between the 2.
To reproduce:
Have a button to open up a rad window with a rich textbox.  click the open window button twice to open up 2 rad windows.  then on each rad rich text box type 'time'.  Now switch back to the other rad window that has time typed in it.  Now type a space and type 'porgs'  or any misspelled word.  It will not be highlighted in red, but if you right click it will show you word suggestions.
0
Iva Toteva
Telerik team
answered on 28 Feb 2012, 05:59 PM
Hello Dan,

Thank you for the follow up and the repro project attached to the support ticket.

We verified that there is a bug. Unfortunately, it cannot be worked around at this point. We will try to fix as soon as possible.  

Kind regards,
Iva Toteva
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
danparker276
Top achievements
Rank 2
answered on 20 Mar 2012, 03:03 AM
I've noticed that switch between windows is ok now in the internal builds, but when I edit some text, sometimes I don't get the red underline.  Is this issue still being worked on?
0
Iva Toteva
Telerik team
answered on 23 Mar 2012, 01:46 PM
Hello Dan,

We have logged the issue and will look into it.
Unfortunately, a fix will not be introduced in the upcoming service pack which is due in less than a week.

Greetings,
Iva Toteva
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
RichTextBox
Asked by
danparker276
Top achievements
Rank 2
Answers by
danparker276
Top achievements
Rank 2
Andrew
Telerik team
Iva Toteva
Telerik team
Share this question
or