SpellCheckErrorClass: 'OffsetInText' property

2 posts, 0 answers
  1. Michael
    Michael avatar
    1 posts
    Member since:
    Jun 2009

    Posted 15 Jun 2009 Link to this post


    I am using RadControls for ASPNET AJAX Q3 2008. I'm utilising the Telerik.Web.UI.SpellChecker class to perform server-side spell checking on plain text as well as HTML strings.

    I require the character offset (i.e. index) of any words failing spell check within the text string, and assumed from the documentation that the SpellCheckError.OffsetInText property would provide just what I needed (documentation below):

    Telerik.Web.UI Namespace > SpellCheckError Class : OffsetInText Property
    The offset in the source text. It is useful for locating the original word and replacing it with one of the suggestions.

    However this property returns the zero-based order of the mistaken word within the list of the words in the text.

    E.g. for the string "Two misspled wordz" the offset property would be 1 (for the "misspled" SpellCheckError) and 2 (for the "wordz" SpellCheckError).

    I notice that the actual character offset is within the SpellCheckError but it's not publicly accessible (SpellCheckError.badWord.Offset)

    My questions:
    1) Is there any way in which to access this property for the Q3 2008 version?
    2) Is this property provided publicly (e.g. in the SpellCheckError class) in a subsequent release?



  2. Lini
    Lini avatar
    2144 posts

    Posted 17 Jun 2009 Link to this post

    Hello Michael,
    We have already replied to your support ticket, but I will also post the answer here, so that it is helpful to others as well:

    You are correct - the OffsetInText property actually returns the word index. We will change it to return the actual offset (badWord.Offset) in the next major RadControls release. We will add a new property "WordIndex" that will return the word index. The new release (Q2 2009) will be out next month.

    For now you have to use the string.IndexOf() method to find the offset of the misspelled word in the text.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft R3 2016 release webinar banner
Back to Top