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

Using the SpellCheckHelper With Radgrid Throws Error

2 Answers 51 Views
SpellChecker
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 22 Jun 2012, 01:56 PM

Using the documentation for setting up the SpellChecker for a RadGridColumn I have the XAML below. However, when I attempt to edit the column I get the following error:

No spellcheck for this type of control!     at Telerik.Windows.Controls.RadGridViewSpellCheckHelper.RadGridView_CellValidating(Object sender, GridViewCellValidatingEventArgs e)

Is there any sort of startup initialization that needs to happen to enable the spell check helper?


RadGrid XAML
<telerik:RadGridView  telerik:RadGridViewSpellCheckHelper.IsSpellCheckingEnabled="True">
...
<telerik:GridViewDataColumn Header="Name" telerik:RadGridViewSpellCheckHelper.IsSpellCheckingEnabled="True">
    <telerik:GridViewDataColumn.CellTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding Name}"
                       TextWrapping="Wrap" />
        </DataTemplate>
    </telerik:GridViewDataColumn.CellTemplate>
    <telerik:GridViewDataColumn.CellEditTemplate>
        <DataTemplate>
            <TextBox Text="{Binding Name, Mode=TwoWay}" />
        </DataTemplate>
    </telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
</telerik:RadGridView>

2 Answers, 1 is accepted

Sort by
0
Karl
Top achievements
Rank 1
answered on 25 Jun 2012, 04:27 PM
I was able to solve this issue with the following code snippet:

/// <summary>
       /// Register the Spell Checkers to the supported controls
       /// </summary>
       public static void RegisterSpellCheckers()
       {
           if (!isRegistered)
           {
               RegisterSpellChecker(new TextBoxSpellChecker());
               RegisterSpellChecker(new RichTextBoxSpellChecker());
               RegisterSpellChecker(new RadRichTextBoxSpellChecker());
               isRegistered = true;
           }
       }
 
       private static void RegisterSpellChecker(IControlSpellChecker controlSpellChecker)
       {
           ControlSpellCheckersManager.RegisterControlSpellChecker(controlSpellChecker);
       }
0
Andrew
Telerik team
answered on 26 Jun 2012, 09:53 AM
Hello Karl,

We are happy to hear that you solved the problem. A little more info: RadSpellChecker uses MEF to load the different ControlSpellCheckers. Unfortunately MEF does not work correctly when the "Reduce XAP size by using application library caching" option is enabled. The solution is exactly the one you have found.

All the best,
Andrew
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
SpellChecker
Asked by
Karl
Top achievements
Rank 1
Answers by
Karl
Top achievements
Rank 1
Andrew
Telerik team
Share this question
or