SpellChecker.DataChanged += is not working anymore

10 posts, 1 answers
  1. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 02 Feb 2012 Link to this post

    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.
  2. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 02 Feb 2012 Link to this post

    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);
  3. DevCraft banner
  4. Answer
    Andrew
    Admin
    Andrew avatar
    140 posts

    Posted 06 Feb 2012 Link to this post

    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 >>
  5. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 06 Feb 2012 Link to this post

    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.
  6. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 08 Feb 2012 Link to this post

    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 >>
  7. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 17 Feb 2012 Link to this post

    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.
  8. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 27 Feb 2012 Link to this post

    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.
  9. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 28 Feb 2012 Link to this post

    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 >>
  10. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 19 Mar 2012 Link to this post

    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?
  11. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 23 Mar 2012 Link to this post

    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 >>
Back to Top
DevCraft banner