SpellCheck not reflecting the spell correction in Rad Textbox

5 posts, 1 answers
  1. sushil jinder
    sushil jinder avatar
    8 posts
    Member since:
    Jun 2009

    Posted 12 Jan 2010 Link to this post

    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
  2. Answer
    Rumen
    Admin
    Rumen avatar
    12849 posts

    Posted 12 Jan 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. sushil jinder
    sushil jinder avatar
    8 posts
    Member since:
    Jun 2009

    Posted 13 Jan 2010 Link to this post

    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
  5. sushil jinder
    sushil jinder avatar
    8 posts
    Member since:
    Jun 2009

    Posted 13 Jan 2010 Link to this post

    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 + "')";
                }
            }
        }

  6. Rumen
    Admin
    Rumen avatar
    12849 posts

    Posted 15 Jan 2010 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017