Knowledgebase Home Page  >  RapidSpell Web ASP.NET  >  Misc
Search the Knowledge Base
Is it possible to use RapidSpell Web with Infragistics' UltraWebGrid?
https://keyoti.com/kb/Default.aspx?ToDo=view&questId=68&catId=60

Options

Print this page
Email this to a friend

The following is an example that demonstrates this, if you have any questions about it please contact us at support@keyoti.com.

 

The code below assumes you have a page called "popup.aspx" with the RapidSpellWeb control on it, it also assumes your grid is called "UltraWebGrid1".

 

If either of those aren't true, please look for those strings in the Javascript code below and change accordingly.

 

The cells that will be checked are specified in this line:

var rapidSpellControls = ["0_0", "1_0", "2_0"];  

 

so that will cause the first 3 rows of the first column to be checked, this could be created in a loop so that it would do all cells.

 

 

This code was produced against version 5.1 of Infragistics suite, however it should be compatible with other versions.

 

<%@ Register TagPrefix="igtbl" Namespace="Infragistics.WebUI.UltraWebGrid" Assembly="Infragistics.WebUI.UltraWebGrid.v5.1, Version=5.1.20051.11, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" %>
<%@ Register TagPrefix="igtxt" Namespace="Infragistics.WebUI.WebDataInput" Assembly="Infragistics.WebUI.WebDataInput.v5.1, Version=5.1.20051.11, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" %>
<%@ Page Language="cs" Codebehind="CellEditors.aspx.cs" AutoEventWireup="false" Inherits="SamplesBrowser.CellEditors" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
 <HEAD>
  <title>CellEditors</title>
  <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
  <meta content="C#" name="CODE_LANGUAGE">
  <meta content="JavaScript" name="vs_defaultClientScript">
  <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  <script>
   // ---- The cells to check <row>_<col>
   var rapidSpellControls = ["0_0", "1_0", "2_0"];  
  </script>
  <script>
function popUpCheckSpellingRS(textareaid)
{
var interfaceObjectName = 'rsTCInt' + textareaid;
var evaltext = interfaceObjectName + ' = new RSStandardInterface(\'' + textareaid + '\')';
eval ( evaltext );
var spellBoot= '';

 

spellBoot = "<html><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>";
spellBoot += "<body onLoad='document.forms[0].submit();'><font face='tahoma' size=2>Spell checking document...</font><form action='/RapidSpellWeb-Demo-CSharp/popup.aspx' method='post'>";
spellBoot += "<input type='hidden' name='textToCheck' value=\"" + escQuotes(escEntities(eval(interfaceObjectName+'.getText()'))) + "\">";
spellBoot += "<input type='hidden' name='InterfaceObject' value='" + interfaceObjectName + "'>";
spellBoot += "<input type='hidden' name='mode' value='popup'>";
spellBoot += "<input type='hidden' name='UserDictionaryFile' value=''>";
spellBoot += "<input type='hidden' name='DictFile' value=''>";
spellBoot += "<input type='hidden' name='SuggestionsMethod' value='HASHING_SUGGESTIONS'>";
spellBoot += "<input type='hidden' name='LanguageParser' value='ENGLISH'>";
spellBoot += "<input type='hidden' name='SeparateHyphenWords' value='False'>";
spellBoot += "<input type='hidden' name='V2Parser' value='False'>";
spellBoot += "<input type='hidden' name='SSLFriendlyPage' value='blank.html'>";
spellBoot += "<input type='hidden' name='ShowFinishedMessage' value='False'>";
spellBoot += "<input type='hidden' name='ShowNoErrorsMessage' value='False'>";
spellBoot += "<input type='hidden' name='CreatePopUpWindow' value='False'>";
spellBoot += "<input type='hidden' name='FinishClosesWindow' value='True'>";
spellBoot += "<input type='hidden' name='FinishedListener' value='notifyDone'>";
spellBoot += "<input type='hidden' name='WarnDuplicates' value='True'>";
spellBoot += "<input type='hidden' name='IgnoreWordsWithDigits' value='True'>";
spellBoot += "<input type='hidden' name='IgnoreURLsAndEmailAddresses' value='True'>";
spellBoot += "<input type='hidden' name='SuggestSplitWords' value='True'>";
spellBoot += "<input type='hidden' name='CheckCompoundWords' value='False'>";
spellBoot += "<input type='hidden' name='CorrectionNotifyListener' value=''>";
spellBoot += "<input type='hidden' name='Modal' value='False'>";
spellBoot += "<input type='hidden' name='InformFinishListenerOfState' value='True'>";
spellBoot += "<input type='hidden' name='PostBackOnFinish' value='False'>";
spellBoot += "<input type='hidden' name='RswlClientID' value='RapidSpellWebLauncher1'>";
spellBoot += "<input type='hidden' name='AllowMixedCase' value='False'>";
spellBoot += "<input type='hidden' name='PopUpWindowName' value='spellCheckWin'>";
spellBoot += "<input type='hidden' name='IncludeUserDictionaryInSuggestions' value='False'>";
spellBoot += "<input type='hidden' name='LookIntoHyphenatedText' value='True'>";
spellBoot += "<input type='hidden' name='GuiLanguage' value='ENGLISH'>";
spellBoot += "<input type='hidden' name='callBack' value=''>";
spellBoot += "<input type='hidden' name='IgnoreXML' value='False'>";
spellBoot += "<input type='hidden' name='IgnoreCapitalizedWords' value='False'>";
spellBoot += "<input type='hidden' name='ConsiderationRange' value='-1'></form></body>";
spellBoot += "</html>";

 

spellCheckWin.focus();
spellCheckWin.document.open();
spellCheckWin.document.write(spellBoot);
spellCheckWin.document.close();
}

 

function RSStandardInterface(tbElementName)
{
this.tbName = tbElementName;
this.getText = getText;
this.setText = setText;
function getText()
{

 

 ///return document.getElementById(this.tbName).value;
 var cell = igtbl_getCellById("<%= UltraWebGrid1.ClientID %>rc_"+this.tbName);
 return cell.getValue();
}
function setText(text)
{
 var cell = igtbl_getCellById("<%= UltraWebGrid1.ClientID %>rc_"+this.tbName);
 return cell.setValue(text);
}
}
function escQuotes(text)
{
var rx = new RegExp("\"", "g"); return text.replace(rx,"&#34;");
}
function escEntities(text)
{
var rx = new RegExp("&", "g"); return text.replace(rx,"&amp;");
}

 


// End of Spell Check Include Code ++++++++++++++++++
// ---- The name of the popup window
var spellCheckWin;

 

// ---- Tracks the next RapidSpellWebLauncher control to be run
var currentlyChecking = 0;
//runs the spell checker for current control in rapidSpellControls
function runSpellCheck()
{
//incase the window was closed during a previous check
if (currentlyChecking>0 && spellCheckWin.closed)
{
currentlyChecking=0;
}
if (currentlyChecking==0)

 

spellCheckWin = window.open('', 'rspellwin', 'resizable=yes,scrollbars=auto,dependent=yes,toolbar=no,left=100,top=100,status=no,location=no,menubar=no,width=370,height=400')
eval("popUpCheckSpellingRS('" + rapidSpellControls[currentlyChecking]+"')");

 

}

 

//listens for checker to finish and starts up next checker if not finished.
function notifyDone()
{
currentlyChecking++;
if(currentlyChecking < rapidSpellControls.length)
{
runSpellCheck();
}
else
{//--finished
spellCheckWin.close();
currentlyChecking=0;
}
}
  </script>
 </HEAD>
 <body bgColor="#f1ffff">
  <form id="CellEditors" method="post" runat="server">
   <P><asp:label id="Label1" runat="server" DESIGNTIMEDRAGDROP="9" Font-Bold="True" Font-Names="Verdana" Font-Size="10pt" Width="660px">WebDataInput as cell-editors in UltraWebGrid</asp:label></P>
   <P><igtbl:ultrawebgrid id="UltraWebGrid1" runat="server" Width="99%" Browser="Xml" Height="229px"><DISPLAYLAYOUT AllowUpdateDefault="Yes" TableLayout="Fixed" Name="UltraWebGrid1" CellPaddingDefault="4" BorderCollapseDefault="Separate" Version="2.00.5000" RowHeightDefault="20px" StationaryMargins="Header" CompactRendering="False" ColWidthDefault=""><ADDNEWBOX>
       <STYLE BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px"></STYLE>
      </ADDNEWBOX>
      <PAGER Alignment="Center" StyleMode="PrevNext">
       <STYLE BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px" ForeColor="DarkSlateBlue" BorderColor="Tan"></STYLE>
      </PAGER>
      <HEADERSTYLEDEFAULT Font-Bold="True" BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px" Cursor="Hand">
       <BORDERDETAILS ColorLeft="White" WidthTop="1px" WidthLeft="1px" ColorTop="White"></BORDERDETAILS>
      </HEADERSTYLEDEFAULT>
      <ROWSELECTORSTYLEDEFAULT BackColor="Desktop" BorderStyle="Outset" BorderWidth="1px"></ROWSELECTORSTYLEDEFAULT>
      <FRAMESTYLE Font-Names="Verdana" Font-Size="8pt" Width="99%" Height="229px" BorderStyle="Ridge" BorderWidth="2px" Cursor="Default"></FRAMESTYLE>
      <FOOTERSTYLEDEFAULT BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
       <BORDERDETAILS ColorLeft="White" WidthTop="1px" WidthLeft="1px" ColorTop="White"></BORDERDETAILS>
      </FOOTERSTYLEDEFAULT>
      <SELECTEDROWSTYLEDEFAULT BackColor="DarkSlateBlue" ForeColor="GhostWhite"></SELECTEDROWSTYLEDEFAULT>
      <ROWALTERNATESTYLEDEFAULT HorizontalAlign="Center"></ROWALTERNATESTYLEDEFAULT>
      <ROWSTYLEDEFAULT BackColor="White" BorderStyle="Solid" BorderWidth="1px" ForeColor="Black" BorderColor="Gray" HorizontalAlign="Center">
       <PADDING Left="3px"></PADDING>
       <BORDERDETAILS WidthTop="0px" WidthLeft="0px"></BORDERDETAILS>
      </ROWSTYLEDEFAULT>
     </DISPLAYLAYOUT>
     <ROWS>
      <igtbl:UltraGridRow Height="">
       <CELLS>
        <igtbl:UltraGridCell Text="Helloo" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="123.45" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="23.45" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="20" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="1/2/2004" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="1/3/2001" Key=""></igtbl:UltraGridCell>
       </CELLS>
      </igtbl:UltraGridRow>
      <igtbl:UltraGridRow Height="">
       <CELLS>
        <igtbl:UltraGridCell Text="Thiss" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="12.45" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="2.45" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="2" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="1/3/2004" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="1/4/2001" Key=""></igtbl:UltraGridCell>
       </CELLS>
      </igtbl:UltraGridRow>
      <igtbl:UltraGridRow Height="">
       <CELLS>
        <igtbl:UltraGridCell Text="is wrung" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="23.45" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="3.45" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="150" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="11/2/2004" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="11/3/2001" Key=""></igtbl:UltraGridCell>
       </CELLS>
      </igtbl:UltraGridRow>
      <igtbl:UltraGridRow Height="">
       <CELLS>
        <igtbl:UltraGridCell Text="1324567809" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="13.5" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="22.45" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="140" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="2/4/2003" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="3/11/2001" Key=""></igtbl:UltraGridCell>
       </CELLS>
      </igtbl:UltraGridRow>
      <igtbl:UltraGridRow Height="">
       <CELLS>
        <igtbl:UltraGridCell Text="1204507808" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="212" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="223" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="320" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="3/7/2004" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="8/8/2001" Key=""></igtbl:UltraGridCell>
       </CELLS>
      </igtbl:UltraGridRow>
      <igtbl:UltraGridRow Height="">
       <CELLS>
        <igtbl:UltraGridCell Text="" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="4/8/2004" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="3/9/2001" Key=""></igtbl:UltraGridCell>
       </CELLS>
      </igtbl:UltraGridRow>
      <igtbl:UltraGridRow Height="">
       <CELLS>
        <igtbl:UltraGridCell Text="1234567808" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="123.45" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="123.45" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="" Key=""></igtbl:UltraGridCell>
        <igtbl:UltraGridCell Text="" Key=""></igtbl:UltraGridCell>
       </CELLS>
      </igtbl:UltraGridRow>
     </ROWS>
     <BANDS>
      <igtbl:UltraGridBand>
       <COLUMNS>
        <igtbl:UltraGridColumn Width="110px" Key="" FooterText="" BaseColumnName="" Type="NotSet" EditorControlID="WebMaskEdit1" HeaderText="Mask">
         <CELLSTYLE HorizontalAlign="Left"></CELLSTYLE>
         <FOOTER Caption=""></FOOTER>
         <HEADER Caption="Mask"></HEADER>
        </igtbl:UltraGridColumn>
        <igtbl:UltraGridColumn Width="70px" Key="" BaseColumnName="" Type="Custom" EditorControlID="WebNumericEdit1" HeaderText="Double">
         <CELLSTYLE HorizontalAlign="Right"></CELLSTYLE>
         <HEADER Caption="Double"></HEADER>
        </igtbl:UltraGridColumn>
        <igtbl:UltraGridColumn Width="130px" Key="" BaseColumnName="" Type="Custom" EditorControlID="WebCurrencyEdit1" HeaderText="Range: -9..90000">
         <CELLSTYLE HorizontalAlign="Right"></CELLSTYLE>
         <HEADER Caption="Range: -9..90000"></HEADER>
        </igtbl:UltraGridColumn>
        <igtbl:UltraGridColumn Width="70px" Key="" BaseColumnName="" Type="Custom" EditorControlID="WebNumericEdit2" HeaderText="Short" FooterTotal="Sum">
         <CELLSTYLE HorizontalAlign="Right"></CELLSTYLE>
         <FOOTER Total="Sum"></FOOTER>
         <HEADER Caption="Short"></HEADER>
        </igtbl:UltraGridColumn>
        <igtbl:UltraGridColumn Width="100px" Key="" BaseColumnName="" Type="Custom" EditorControlID="WebDateTimeEdit1" HeaderText="Date" FooterTotal="Sum">
         <FOOTER Total="Sum"></FOOTER>
         <HEADER Caption="Date"></HEADER>
        </igtbl:UltraGridColumn>
        <igtbl:UltraGridColumn Width="240px" Key="" BaseColumnName="" Type="Custom" EditorControlID="WebDateTimeEdit2" HeaderText="Range: 1/1/1920-12/31/2090" FooterTotal="Sum">
         <FOOTER Total="Sum"></FOOTER>
         <HEADER Caption="Range: 1/1/1920-12/31/2090"></HEADER>
        </igtbl:UltraGridColumn>
       </COLUMNS>
      </igtbl:UltraGridBand>
     </BANDS>
    </igtbl:ultrawebgrid></P>
   <P>&nbsp;</P>
   <P><asp:button id="Button1" runat="server" Text="Submit"></asp:button><igtxt:webdatetimeedit id="WebDateTimeEdit2" runat="server" BorderStyle="None" EditModeFormat="f" MinValue="1920-01-01" MaxValue="2090-12-31"></igtxt:webdatetimeedit></P>
   <P><igtxt:webnumericedit id="WebNumericEdit1" runat="server" BorderStyle="None"><SPINBUTTONS Display="OnRight"></SPINBUTTONS>
    </igtxt:webnumericedit><igtxt:webcurrencyedit id="WebCurrencyEdit1" runat="server" Width="110px" Height="20px" BorderStyle="None" MinValue="-9" MaxValue="90000"><SPINBUTTONS Display="OnRight"></SPINBUTTONS>
    </igtxt:webcurrencyedit><igtxt:webmaskedit id="WebMaskEdit1" runat="server" BorderStyle="None" InputMask="(###) ###-####"></igtxt:webmaskedit><igtxt:webnumericedit id="WebNumericEdit2" runat="server" BorderStyle="None" DataMode="Short"></igtxt:webnumericedit>
    <igtxt:WebDateTimeEdit id="WebDateTimeEdit1" runat="server" BorderStyle="None" HorizontalAlign="Center">
     <SPINBUTTONS Display="OnRight"></SPINBUTTONS>
    </igtxt:WebDateTimeEdit></P>
   <input type="button" onclick="runSpellCheck()" value="Spell check">
  </form>
 </body>
</HTML>

 


Related Questions:

Attachments:

No attachments were found.