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

SpellCheck not reflecting the spell correction in Rad Textbox

4 Answers 185 Views
Spell
This is a migrated thread and some comments may be shown as answers.
sushil jinder
Top achievements
Rank 1
sushil jinder asked on 12 Jan 2010, 07:53 AM
Hi,

I am using the ASP.NET AJAX Spell checker with the Rad Textbox,
Scenario :
User types some text in the RAD textbox and click the spell control for spell checking, spell cheker is invoked and suitable suggestions are shown to the user, users select the best suggestion for the misspelt word. Spell checker shows the message "Spelling checking complete". Till here all is well, but the suggested word is not reflected in the source RAD textbox. The trick here is once you click the textbox, it will now show the suggested word in textbox.

The problem seems with this pair (Spell + RAD textbox) only, if we use the normal ASP.NET textbox, it work fine.

Please advice me the solution in this case. Any further info please revert.

Thanks,
Sushil Jinder

4 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 12 Jan 2010, 12:07 PM
Hi Sushil,

Please, see the following help article on the topic: Spell Checking RadTextBox.

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
sushil jinder
Top achievements
Rank 1
answered on 13 Jan 2010, 11:36 AM
Hi Rumen,

Foremost thanks for your response and helping me.
The solution provided by you work fine in case we pass hard coded value to JS function As you did as follows :

function SpellCheckDone() {
         var radTextBox1 = $find("<%= txt1.ClientID %>");
         radTextBox1.updateDisplayValue();
     }

But in my case where the RADTextbox will be a part of each row in grid and I have to pass the RAD textbox's client id as a paramater, the solution creates problem and throws an JS error "Microsoft JScript runtime error: Object doesn't support this property or method"

I have made a small demo to reproduce  this behavior. I am attaching step by step snapshots for how to reach to JS error.
Hope this will help you to easily understand our problem.
Waiting for your kind support.

Regards,
Sushil Jinder
0
sushil jinder
Top achievements
Rank 1
answered on 13 Jan 2010, 11:43 AM
SOURCE CODE GOES HERE

aspx PAGE
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="_WebForm1.aspx.cs" Inherits="Presentation.UserControls.PerformanceRecording._WebForm1" %>

<%@ Register Assembly="CustomControls" Namespace="CustomControls" TagPrefix="Custom" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>jkjkjk</title>
</head>
<body>
    <script language="javascript" type="text/javascript">
        //    *************  working solution
        //     function SpellCheckDone() {
        //         var radTextBox1 = $find("<%= this.txt1.ClientID %>");
        //         radTextBox1.updateDisplayValue();
        //     }


        //    ************** NOT working solution
        function SpellCheckDone(txtboxId) {
            //alert(txtboxId);
            var radTextBox1 = $find(txtboxId);
            radTextBox1.updateDisplayValue();
        }
    </script>

    <form id="form1" runat="server">
    <Custom" :ScriptManager runat="server" ID="mgr1">
    </Custom" :ScriptManager>
    <div>
        <table>
            <tr>
                <td colspan="2">
                    Sample - Spell Checker with RAD TextBox
                </td>
            </tr>
            <tr>
                <td>
                    <Custom" :TextBox ID="txt1" runat="server" Width="339px" Text="he neds improvement"
                        Height="23px">
                    </Custom" :TextBox>
                </td>
                <td>
                    <Custom" :Spell ID="spell1" runat="server" ControlsToCheck="txt1" Width="83px" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>

aspx.CS PAGE

public partial class _WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                spell1.OnClientDialogClosed = "SpellCheckDone('" + txt1.ClientID + "')";
            }
        }
    }

0
Rumen
Telerik team
answered on 15 Jan 2010, 04:22 PM
Hi Sushil,

The proper way to achieve your scenario is to loop through all Telerik controls on the page, get all RadTextBox controls instances and update their value. You can see how to iterate through the RadTextBoxes in this KB article:
How-to create a javascript array of all particular RadControls on the page.

Greetings,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Spell
Asked by
sushil jinder
Top achievements
Rank 1
Answers by
Rumen
Telerik team
sushil jinder
Top achievements
Rank 1
Share this question
or