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

RichTextBox in Grid Cell with Spelling suggestions

2 Answers 62 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Duane
Top achievements
Rank 1
Duane asked on 12 May 2011, 10:59 PM
I have a couple of problems while evaluating the Telerik Silverlight controls

I was hoping I could just have a simple text box control in a GridView with spell checking, but it looks like I need to use the RadRichTextbox control. The users will be entering text, no text formatting is necessary. So, I don't want to display any formatting menus.

So, here are the problems:
1) The starting font size is too large.  How can I set the default font size?
2) I have the dictionary, so only misspelled words are underlined, but Suggested words do not show up when I click the misspelled word.  How can I get the suggested word to show up?

Thanks,
Duane

2 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 18 May 2011, 12:57 PM
Hello Duane,
Have you checked out RadSpellChecker? It can be used on GridView cells, as well as DataGrid cells. The suggestions for the misspelled words are shown in an additional pop-up that enables you to choose one of the suggestions or add the word to the dictionary.
As for your RadRichTextBox questions:
     0.   In case you don't want to show the SelectionMiniToolBar, you can set the property                                              IsSelectionMiniToolBarEnabled to False.
  1. The default font size can be set in the following way:
    <telerik:RadRichTextBox FontSize="12" DocumentInheritsDefaultStyleSettings="True" />
  2. You can also set these properties in code-behind. In that case, you can make use of the Unit class, which provides methods for conversion between different measurement units - PointToDip, DipToPoint, etc.
  3. The suggestions for misspelled words are normally shown in the context menu on right click. In order to use the ContextMenu, IsContextMenuEnabled should be true (default value is true) and you need to include references to the following assemblies:
    1. Telerik.Windows.Controls;
    2. Telerik.Windows.Controls.Input;
    3. Telerik.Windows.Controls.Navigation;
    4. Telerik.Windows.Controls.RadRibbonBar;
    5. Telerik.Windows.Controls.RichTextBoxUI.
You can read more about the customization of the context menu in our online documentation. Most probably, you would need to remove the Font and Paragraph items from the context menu, as they provide means for rich text formatting.
You can also disable the default key bindings for bold, italics, underlines, opening the font properties dialog, etc, by assigning empty commands to the KeyBindings in the following way:
<telerik:RadRichTextBox Name="rrtb0" Grid.Row="1" >
    <telerik:CommandManager.InputBindings>
        <telerik:InputBindingCollection>
            <!-- bold -->
            <telerik:KeyBinding Gesture="Ctrl+Shift+B" />
            <telerik:KeyBinding Gesture="Ctrl+B" />
            <!-- underline -->
            <telerik:KeyBinding Gesture="Ctrl+U" />
            <!-- italics -->
            <telerik:KeyBinding Gesture="Ctrl+I" />
            <!-- font properties dialog -->
            <telerik:KeyBinding Gesture="Ctrl+D" />              
            <!-- insert hyperlink dialog -->
            <telerik:KeyBinding Gesture="Ctrl+K" />
            <!-- paragraph align left -->
            <telerik:KeyBinding Gesture="Ctrl+L" />
            <!-- paragraph align right -->
            <telerik:KeyBinding Gesture="Ctrl+R" />
            <!-- paragraph align center -->
            <telerik:KeyBinding Gesture="Ctrl+E" />
            <!-- paragraph align justify -->
            <telerik:KeyBinding Gesture="Ctrl+J" />
            <!-- find replace dialog -->
            <telerik:KeyBinding Gesture="Ctrl+F" />
        </telerik:InputBindingCollection>
    </telerik:CommandManager.InputBindings>
</telerik:RadRichTextBox>

I hope this answers your questions.

Kind regards,
Iva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Duane
Top achievements
Rank 1
answered on 24 May 2011, 08:36 PM
Hi Iva,

Thanks a lot for your response...I'm now moving toward the RadSpellCheck solution in the RadGridView and it works beautifully!!!

Thanks again!
-Duane
Tags
RichTextBox
Asked by
Duane
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Duane
Top achievements
Rank 1
Share this question
or