new line in spell check control while checking multiple controls..Urgenttttttt

4 posts, 0 answers
  1. SANNIDHI
    SANNIDHI avatar
    24 posts
    Member since:
    May 2009

    Posted 12 Jun 2012 Link to this post

    The spell check control inserts a newline when the control is empty. Is there anyway i can avoid that. I have attached a screenshot of the problem.

    One way i was thinking about doing it was dynamically adding/removing controls to the spellcheck depending on the content of the controls.

    You can reproduce the behavior on your demo page.
    http://demos.telerik.com/aspnet-ajax/spell/examples/multiplechecks/defaultcs.aspx
  2. Jack
    Jack avatar
    3 posts
    Member since:
    Jul 2012

    Posted 10 Jul 2012 Link to this post

    I am experiencing the same issue.  Is there a work around for this problem?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Jul 2012 Link to this post

    Hi,

    Try the following Javascript to achieve your scenario.

    JS:
    <script type="text/javascript">
     var controls;
     function OnClientCheckStarted(sender, args)
     {
      controls = sender._textSource.get_elements();
      var control;
      var count = 0;
      var toCheck = new Array();
      for (i = 0; i < controls.length; i++)
      {
       if ("" != sender._textSource._elements[i].get_text())
       {
        toCheck[count] = controls[i];
        count++;
       }
      }
      sender._textSource.set_elements(toCheck);
     }
     function OnClientDialogClosed(sender, args)
     {
      var check = $find("<%=RadSpell1.ClientID %>");
      check._textSource.set_elements(controls);
     }
    </script>

    Hope this helps.

    Thanks,
    Princy.
  5. Jack
    Jack avatar
    3 posts
    Member since:
    Jul 2012

    Posted 11 Jul 2012 Link to this post

    Princy, that achieved exactly what I was looking for, thank you.

    Jack
Back to Top