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

Custom dictionary reset

1 Answer 46 Views
RichTextBox (obsolete as of Q3 2014 SP1)
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 18 Aug 2014, 12:43 AM
When I import text into my rich text control (2014.2.715), the custom dictionary is lost.

I'm using the following code:
var provider = new RtfFormatProvider();
rtf.Document = provider.Import(value);

I'm using the following to set my custom dictionary:
var culture = CultureInfo.GetCultureInfo("en-AU");
var checker = (DocumentSpellChecker)rtf.SpellChecker;
if (!(checker.GetDictionary(culture) is AustralianDictionary))
{
checker.AddDictionary(new AustralianDictionary(), culture);
}
rtf.SpellChecker.SpellCheckingCulture = culture;

Am I doing something wrong?  What is the correct way to set a custom dictionary?


1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 20 Aug 2014, 02:02 PM
Hello Jason,

Thank you for writing.

In this case this is how the rich text box is constructed. Your approach is correct, but you should set the custom dictionary after the document is imported. This is the current default behavior and we will consider to change it in a future release.

Do not hesitate to contact us if you have other questions.
 
Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
RichTextBox (obsolete as of Q3 2014 SP1)
Asked by
Jason
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or