Reduce the height of spell dialog

7 posts, 0 answers
  1. kachy
    kachy avatar
    89 posts
    Member since:
    Aug 2005

    Posted 11 Nov 2010 Link to this post

    Hi,

    Is there a way, I can reduce the height for the spell dialog? I have to open that inside a RadPane (height is around 300) in a RadSplitter, so I need to reduce the size.

    Thanks
  2. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 12 Nov 2010 Link to this post

    Hello Kachy,

    The content of RadSpell dialog has fixed size and it is not possible to be resized using the provided public API and functionality of the control. The only possible way to reduce the contents size is by using JavaScript and DOM methods and properties but this is not supported by Telerik.

    If you would like you can configure RadSpell to use the browser's dialog, which will pop up outside of the RadPane control.

    <asp:TextBox ID="textbox1" TextMode="MultiLine" runat="server"></asp:TextBox>
    <telerik:radSpell runat="server" ID="RadSpell1" ControlsToCheck="textbox1" OnClientLoad="OnClientLoad"></telerik:RadSpell>
    <script type="text/javascript">
        function OnClientLoad(spell, args) {
            spell.set_useClassicDialogs(true);
        }
    </script>

    Best regards,
    Rumen
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. kachy
    kachy avatar
    89 posts
    Member since:
    Aug 2005

    Posted 01 Dec 2010 Link to this post

    The solution you provided works with Telerik Version 2010.2.929.35 but we are still using 2008.3.1314.35 telerik version on our production environment. It gives Microsoft JScript runtime error: Invalid procedure call or argument in older version.

    For spell.set_useClassicDialogs(

    true);- is the syntax different for older version? The error comes for the javascript -

     

    _4.Function._validateParams=

    new _4.Function();

     

     

    Thanks.

     

  5. kachy
    kachy avatar
    89 posts
    Member since:
    Aug 2005

    Posted 01 Dec 2010 Link to this post

    I have one more question, is there a way to enable/disable or visible/invisible RadSpell control client side(using javascript)?

    Thanks.
  6. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 02 Dec 2010 Link to this post

    Hi Kachy,

    Version 2008.3.1314.35 does not offer the set_useClassicDialogs() method and this functionality is not supported. My recommendation is to upgrade to the latest version to be able to use this method.

    RadSpell does not offer clien-side API for enable or disable the control, but you can wrap it in a div element and show and hide the div with JavaScript code, e.g.


    // hide the div
    $get("divWrapper").style.display = "none";

    //show the div
    $get("divWrapper").style.display = "";

    ...

    <div id="divWrapper">
          <telerik:RadSpell id="RadSpell1" runat="server" ... />
    </div>


    Regards,
    Rumen
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  7. kachy
    kachy avatar
    89 posts
    Member since:
    Aug 2005

    Posted 08 Dec 2010 Link to this post

    The solution you provided to place the Spelll control inside Div tag worked fine. I have one more question. I want to check the spelling of 5 textarea but I want to set the value Controlstocheck for RadSpell dynamically based on certailn conditions. If the checkbox is not checked, then my textarea is readonly, so I want the radspelll to skip readonly textarea.
    function StartSpellAllFields() {
               var allSpellFields = "";
               if (document.getElementById('<%= cbTextArea1%>').checked == true) {
                   allSpellFields = "<%= txtArea1.ClientID %>"; 
               }
               if (document.getElementById('<%= cbTextArea2.ClientID%>').checked == true) {
                   if (allSpellFields == "") {
                       allSpellFields = "<%= txtArea2.ClientID %>";
                   }
                   else {
                    allSpellFields = allSpellFields + "," + "<%= txtArea2.ClientID %>";
                   }
               }
               var spell = $find('<%= RadSpellAll.ClientID %>');
               spell.set_controlToCheck(null);
      
               spell.set_textSource(null);
               if (allSpellFields != "") {
                   spell.set_controlsToCheck(allSpellFields);
                   spell.startSpellCheck();
               }
            }
    <telerik:RadSpell ID="RadSpellAll" Runat="server" ButtonText="Spell Check" 
                                           
             ControlToCheck="txtArea1" 
             OnClientLoad="OnClientLoad" Visible= "True"
                                         IsClientID="true" ButtonType="None" 
             AllowAddCustom="False" />
             <input id="Button1" type="button" value="Spell Check All" onclick="StartSpellAllFields();" />

    Adding ControlsToCheck gives me following error - Could not find target HTML element. Please verify that ControlToCheck/ControlsToCheck points to valid HTML controls.

    I already saw the help information where you can check Multiple Controls text at the same time. I want RadSpell to work like one by one for each control, how it works when you add the ControlsToCheck in aspx page directly.

    Thanks.
  8. kachy
    kachy avatar
    89 posts
    Member since:
    Aug 2005

    Posted 10 Dec 2010 Link to this post

    I figured out how to do that. If you add multiple controlstocheck, radspell does spell check for all the texts collectively instead doing one by one, so I used the same logic explained in http://www.telerik.com/help/aspnet-ajax/spell_howtomutlipletextareas.html

    Thanks.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017