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

RadMarkupDialog and SpellCheck

1 Answer 40 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Mike Maynard
Top achievements
Rank 1
Mike Maynard asked on 04 Jun 2014, 03:05 PM
Hi all,
I am currently using the RadMarkupDialog to enable HTML markup on a column in a RadGridView.
I would like to enable spell check on the entered text somehow but cannot seem to see how to do this.

The code I am using to display the dialog and set the text is

Dim dialog As New RadMarkupDialog()
                            dialog.DefaultFont = RadGridView1.Font
                            dialog.Editor.RibbonBar.CommandTabs(1).Enabled = False
                            dialog.Editor.HyperlinkButton.Enabled = False
                            dialog.Value = RadGridView1.CurrentCell.Text
                            Dim result As DialogResult = dialog.ShowDialog()
                            If result = DialogResult.OK Then
                                Me.RadGridView1.CurrentCell.Value = dialog.Value
                            Else
                            End If

Any ideas on how to do this?

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 09 Jun 2014, 09:42 AM
Hello Mike,

Thank you for writing.

RadMarkupDialog uses WebBrowser to display the HTML-like text. It is not possible to spell check it using the RadSpellChecker for example, as it supports only RadTextBox, RadTextBoxControl and TextBox controls. The possible solution that I can suggest is to use the RadGridView.CellValidating event in order to validate the active editor's content, when the current cell exits edit mode. Thus, if the html content is incorrect, canceling the CellValidating event, will keep the editor active until a valid text is entered. 
Private Sub RadGridView1_CellEditorInitialized(sender As Object, e As GridViewCellEventArgs) _
Handles RadGridView1.CellEditorInitialized
 
    If e.Column.HeaderText = "HTMLcolumn" Then
        Dim dialog As New RadMarkupDialog()
        dialog.DefaultFont = RadGridView1.Font
        dialog.Editor.RibbonBar.CommandTabs(1).Enabled = False
        dialog.Editor.HyperlinkButton.Enabled = False
        dialog.Value = RadGridView1.CurrentCell.Value
       
        Dim result As DialogResult = dialog.ShowDialog()
        If result = DialogResult.OK Then
            e.ActiveEditor.Value = dialog.Value
        End If
    End If
End Sub
 
Private Sub RadGridView1_CellValidating(sender As Object, e As CellValidatingEventArgs) _
Handles RadGridView1.CellValidating
    If Me.RadGridView1.CurrentColumn.HeaderText = "HTMLcolumn" Then
        Dim htmlText = Me.RadGridView1.ActiveEditor.Value
        'perform validation of the text and if it is incorrect, cancel the event
    End If
End Sub

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Desislava
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
TextBox
Asked by
Mike Maynard
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or