New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

Telerik RadSpell

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
[EmbeddedSkin("Spell")]
[EmbeddedSkin("Spell", "Default")]
[ClientScriptResource("Telerik.Web.UI.RadSpell", "Telerik.Web.UI.Spell.RadSpell.js")]
[TelerikToolboxCategory("Miscellaneous")]
[ToolboxBitmap(typeof(RadSpell), "Toolbox.Icons.Spell.png")]
[ValidationProperty("SpellChecked")]
public class RadSpell : RadWebControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl, INamingContainer

Inheritance: objectControlWebControlRadWebControlRadSpell

Implements: IAttributeAccessorIComponentIControlIControlBuilderAccessorIControlDesignerAccessorIControlResolverIDataBindingsAccessorIDisposableIExpressionsAccessorINamingContainerIParserAccessorIPostBackDataHandlerIScriptControlISkinnableControlIUrlResolutionService...

Inherited Members WebControl.AddAttributesToRender(HtmlTextWriter)WebControl.ApplyStyle(Style)WebControl.CopyBaseAttributes(WebControl)WebControl.CreateControlStyle()WebControl.LoadViewState(object)WebControl.TrackViewState()WebControl.MergeStyle(Style)WebControl.Render(HtmlTextWriter)WebControl.RenderBeginTag(HtmlTextWriter)WebControl.RenderEndTag(HtmlTextWriter)WebControl.SaveViewState()WebControl.AccessKeyWebControl.AttributesWebControl.BackColorWebControl.BorderColorWebControl.BorderWidthWebControl.BorderStyleWebControl.ControlStyleWebControl.ControlStyleCreatedWebControl.CssClassWebControl.DisabledCssClassWebControl.StyleWebControl.EnabledWebControl.EnableThemingWebControl.FontWebControl.ForeColorWebControl.HasAttributesWebControl.HeightWebControl.IsEnabledWebControl.SupportsDisabledAttributeWebControl.SkinIDWebControl.TagNameWebControl.ToolTipWebControl.WidthControl.ResolveAdapter()Control.HasEvents()Control.GetRouteUrl(object)Control.GetRouteUrl(string, object)Control.GetRouteUrl(RouteValueDictionary)Control.GetRouteUrl(string, RouteValueDictionary)Control.GetUniqueIDRelativeTo(Control)Control.ApplyStyleSheetSkin(Page)Control.OnDataBinding(EventArgs)Control.DataBind()Control.DataBind(bool)Control.DataBindChildren()Control.AddParsedSubObject(object)Control.EnsureID()Control.ClearChildState()Control.ClearChildControlState()Control.ClearChildViewState()Control.ClearEffectiveClientIDMode()Control.ClearCachedClientID()Control.Focus()Control.LoadControlState(object)Control.MapPathSecure(string)Control.OpenFile(string)Control.OnLoad(EventArgs)Control.OnPreRender(EventArgs)Control.BuildProfileTree(string, bool)Control.SaveControlState()Control.RenderChildren(HtmlTextWriter)Control.RenderControl(HtmlTextWriter)Control.RenderControl(HtmlTextWriter, ControlAdapter)Control.OnUnload(EventArgs)Control.Dispose()Control.RaiseBubbleEvent(object, EventArgs)Control.OnBubbleEvent(object, EventArgs)Control.AddedControl(Control, int)Control.CreateControlCollection()Control.ResolveUrl(string)Control.ResolveClientUrl(string)Control.FindControl(string)Control.FindControl(string, int)Control.GetDesignModeState()Control.HasControls()Control.IsLiteralContent()Control.EnsureChildControls()Control.RemovedControl(Control)Control.SetDesignModeState(IDictionary)Control.SetRenderMethodDelegate(RenderMethod)Control.ClientIDModeControl.ClientIDControl.ClientIDSeparatorControl.ContextControl.AdapterControl.DesignModeControl.EventsControl.IDControl.IsChildControlStateClearedControl.EnableViewStateControl.ViewStateModeControl.IsViewStateEnabledControl.NamingContainerControl.IdSeparatorControl.LoadViewStateByIDControl.PageControl.RenderingCompatibilityControl.TemplateControlControl.ParentControl.TemplateSourceDirectoryControl.AppRelativeTemplateSourceDirectoryControl.SiteControl.VisibleControl.UniqueIDControl.HasChildViewStateControl.ControlsControl.ValidateRequestModeControl.ViewStateControl.ViewStateIgnoresCaseControl.ChildControlsCreatedControl.IsTrackingViewStateControl.DisposedControl.DataBindingControl.InitControl.LoadControl.PreRenderControl.Unloadobject.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

C#
public RadSpell()

Properties

Gets or sets an additional querystring appended to the dialog URL.

C#
public string AdditionalQueryString { get; set; }
Property Value:

A String, appended to the dialog URL

Gets or sets the URL which the AJAX call will be made to. Check the help for more information.

C#
public string AjaxUrl { get; set; }

Gets or sets the value indicating whether the spell will allow adding custom words.

C#
public bool AllowAddCustom { get; set; }
Property Value:

The default is true

Gets or sets the text of the button that will start the spellcheck. This property is localizable.

C#
public string ButtonText { get; set; }
Property Value:

The default is Spell Check

Gets or sets the type of the button that will start the spellcheck.

C#
public ButtonType ButtonType { get; set; }
Property Value:

The default is PushButton

Values allowed: PushButton/LinkButton/ImageButton/ None.

Setting the value to None will not render a button. The only way to start a spellcheck will be through the client-side API.

Gets or sets the class of the client side text source object.

C#
[ClientControlProperty]
public string ClientTextSource { get; set; }
Property Value:

A string containing the name of the JavaScript class. The default is HtmlElementTextSource -- a built in implementation that obtains the source from a HTML element.

The text source is a JavaScript object. It has to provide two methods: GetText() and SetText(newValue).

Example:
C#
<script type="text/javascript">
function DifferentControlsSource()
{
this.GetText = function()
{
return document.getElementById('before').value;
}

this.SetText = function(newValue)
{
document.getElementById('after').value = newValue;
}
}
</script>

An array of IDs of the control to check.

C#
[TypeConverter(typeof(ListConverter))]
public string[] ControlsToCheck { get; set; }

The IDs can be server-side or client-side. RadSpell will find the appropriate server control and use its ClientID to attach to it. Note that you cannot mix server and client IDs in this list - use only one kind.

The ID of the control to check.

C#
[TypeConverter(typeof(ControlIDConverter))]
public string ControlToCheck { get; set; }

The ID can be both a server-side ID, or a client-side ID. RadSpell will find the appropriate server control and use its ClientID to attach to it.

Gets or sets the fully qualified type name that will be used to store and read the custom dictionary.

C#
public string CustomDictionarySourceTypeName { get; set; }

The type name must be fully qualified if the type is in a GAC-deployed assembly. The type must implement the ICustomDictionarySource interface.

Example:
cs-api-definition
spell1.CustomDictionarySourceTypeName = "RadSpellExtensions.CustomDictionarySource, RadSpellExtensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b5e57ccb698eab8e";

Gets or sets the suffix for the custom dictionary files.

C#
public string CustomDictionarySuffix { get; set; }
Property Value:

The default is -Custom

The filenames are formed with the following scheme: Language + CustomDictionarySuffix + ".txt". Different suffixes can be used to create different custom dictionaries for different users.

Gets or sets the location of a CSS file, that will be added in the dialog window. If you need to include more than one file, use the CSS @import url(); rule to add the other files from the first. This property is needed if you are using a custom skin. It allows you to include your custom skin CSS in the dialogs, which are separate from the main page.

C#
public string DialogsCssFile { get; set; }

Gets or sets the location of a JavaScript file, that will be added in the dialog window. If you need to include more than one file, you will need to combine the scripts into one first. This property is needed if want to override some of the default functionality without loading the dialog from an external ascx file.

C#
public string DialogsScriptFile { get; set; }

Gets or sets the assembly qualified name of the SpellDialog type.

C#
public string DialogTypeName { get; set; }
Property Value:

The default is string.Empty

Gets or sets the virtual path of the UserControl that represents the SpellDialog.

C#
public string DialogVirtualPath { get; set; }
Property Value:

The default is string.Empty

Gets or sets the dictionary language used for spellchecking.

C#
[ClientControlProperty]
public string DictionaryLanguage { get; set; }
Property Value:

The default is en-US

The language name is used to find a corresponding dictionary file. Spellchecking in en-US will work only if a file en-US.TDF can be found inside the folder pointed to by DictionaryPath.

Gets or sets the path for the dictionary files.

C#
public string DictionaryPath { get; set; }
Property Value:

The default is ~/RadControls/Spell/TDF/

This is the path that contains the TDF files, and the custom dictionary TXT files.

Gets or sets a the edit distance. If you increase the value, the checking speed decreases but more suggestions are presented. Applicable only in EditDistance mode.

C#
public int EditDistance { get; set; }
Property Value:

The default is 1

This property takes effect only if the SpellCheckProvider property is set to EditDistanceProvider.

Gets or sets the value, indicating whether to render the skin CSS files during Ajax requests

C#
public override bool EnableAjaxSkinRendering { get; set; }

Overrides: RadWebControl.EnableAjaxSkinRendering

Implements: ISkinnableControl.EnableAjaxSkinRendering

If EnableAjaxSkinRendering is set to false you will have to register the needed control base CSS file by hand when adding/showing the control with Ajax.

Gets or sets the value, indicating whether to render the link to the embedded base stylesheet of the control or not.

C#
public override bool EnableEmbeddedBaseStylesheet { get; set; }

Overrides: RadWebControl.EnableEmbeddedBaseStylesheet

If EnableEmbeddedBaseStylesheet is set to false you will have to register the needed control base CSS file by hand.

Gets or sets the value, indicating whether to render links to the embedded client scripts or not.

C#
public override bool EnableEmbeddedScripts { get; set; }

Overrides: RadWebControl.EnableEmbeddedScripts

Implements: ISkinnableControl.EnableEmbeddedScripts

If EnableEmbeddedScripts is set to false you will have to register the needed script files by hand.

Gets or sets the value, indicating whether to render links to the embedded skins or not.

C#
public override bool EnableEmbeddedSkins { get; set; }

Overrides: RadWebControl.EnableEmbeddedSkins

If EnableEmbeddedSkins is set to false you will have to register the needed CSS files by hand.

Configures the spellchecker engine, so that it knows whether to skip URL's, email addresses, and filenames and not flag them as erros.

C#
public FragmentIgnoreOptions FragmentIgnoreOptions { get; set; }

Gets or sets the URL for the spell dialog handler

C#
public string HandlerUrl { get; set; }
Property Value:

the relative path for the spell dialog handler

Gets or sets a value indicating whether whether the ControlToCheck property provides a client element ID or a server side control ID.

C#
public bool IsClientID { get; set; }
Property Value:

The default is false.

When true RadSpell will look for the server-side control and get its ClientID. When false the ControlToCheck property will be interpreted as a client-side ID and will be used to attach to the target control.

Gets or sets the localization language for the user interface.

C#
[Bindable(true)]
public string Language { get; set; }
Property Value:

The localization language for the user interface. The default value is en-US.

Gets or sets a value indicating where the soell will look for its .resx localization files. By default these files should be in the App_GlobalResources folder. However, if you cannot put the resource files in the default location or .resx files compilation is disabled for some reason (e.g. in a DotNetNuke environment), this property should be set to the location of the resource files.

C#
public string LocalizationPath { get; set; }
Property Value:

A relative path to the dialogs location. For example: "~/controls/RadControlsResources/".

If specified, the LocalizationPath property will allow you to load the spell localization files from any location in the current web application.

Specifies the name of the client-side function that will be called when the user cancels the spell check.

C#
[ClientControlEvent]
[ClientPropertyName("clientCheckCancelled")]
public string OnClientCheckCancelled { get; set; }

The function should accept two parameters: sender (the spell client object) and arguments.

Example:
C#
function onCheckCancelled(sender, args)
{
log("spell: " + sender.clientId + " cancelled for: " + sender.targetControlId);
}

Gets or sets the name of the client-side function that will be called when the spell check is finished.

C#
[ClientControlEvent]
[ClientPropertyName("clientCheckFinished")]
public string OnClientCheckFinished { get; set; }

The function should accept two parameters: sender (the spell client object) and arguments.

Example:
C#
function onCheckFinished(sender, args)
{
log("spell: " + sender.clientId + " finished for: " + sender.targetControlId);
}

Gets or sets the name of the client-side function that will be called when the spell check starts.

C#
[ClientControlEvent]
[ClientPropertyName("clientCheckStarted")]
public string OnClientCheckStarted { get; set; }

The function should accept two parameters: sender (the spell client object) and arguments.

Example:
C#
function onCheckStarted(sender, args)
{
log("spell: " + sender.clientId + " started for: " + sender.targetControlId);
}

Specifies the name of the client-side function that will be called before the spell check dialog closes.

C#
public string OnClientDialogClosed { get; set; }

The function should accept two parameters: sender (the dialog opener client object) and arguments.

Example:
C#
function onDialogClosed(sender, args)
{
alert("spell: " + sender.get_id()+ " dialog closed");
}

Gets or sets the name of the client-side function that will be called when the spell control is initialized on the page.

C#
[ClientControlEvent]
[ClientPropertyName("load")]
public string OnClientLoad { get; set; }

The function should accept two parameters: sender (the spell client object) and arguments.

Example:
C#
function onSpellLoad(sender, args)
{
log("spell: " + sender.get_id() + " ready.");
}

Specifies the rendering mode of the control. Setting the mode to Lightweight will yield HTML 5/CSS 3 html and css.

C#
public override RenderMode RenderMode { get; set; }

Overrides: RadWebControl.RenderMode

Implements: ISkinnableControl.RenderMode

Lightweight rendering mode might change the outlook of the component in some older browsers that don't support CSS3/HTML5.

Gets or sets the skin name for the control user interface.

C#
[TypeConverter("Telerik.Web.Design.SkinTypeConverter, Telerik.Web.Design, Version=2026.3.812.462, Culture=neutral, PublicKeyToken=121fae78165ba3d4")]
public override string Skin { get; set; }
Property Value:

A string containing the skin name for the control user interface. The default is string.Empty.

Overrides: RadWebControl.Skin

Implements: ISkinnableControl.Skin

If this property is not set, the control will render using the skin named "Default". If EnableEmbeddedSkins is set to false, the control will not render skin.

Gets a value indicating if the target control has been spellchecked.

C#
[Browsable(false)]
public bool SpellChecked { get; }

Spellchecking the entire text by the client would set the property to true on postback.

The property is used by the SpellCheckValidator class. You can set it on the client side with RadSpell's SetSpellChecked(false) on various events, say a TEXTAREA's OnChange.

Specifies the spellchecking algorithm which will be used by RadSpell.

C#
public SpellCheckProvider SpellCheckProvider { get; set; }
Property Value:

The default is PhoneticProvider

Allows the use of a custom spell checking provider. It must implement the ISpellCheckProvider interface.

C#
public string SpellCheckProviderTypeName { get; set; }
Property Value:

The default is PhoneticProvider

Gets or sets the supported languages.

C#
[TypeConverter(typeof(ListConverter))]
public string[] SupportedLanguages { get; set; }
Property Value:

A string array containing the codes and names of the languages (code, name, code, name...)

The supported languages will be displayed in a drop-down list, and the user can select the language for spellchecking.

Example:
C#
<radS:RadSpell ID="spell1"
Runat="server"
ControlToCheck="textBox1"
SupportedLanguages="en-US,English,fr-FR,French">
</radS:RadSpell>
C#
protected override bool SupportsRenderingMode { get; }

Overrides: RadWebControl.SupportsRenderingMode

Gets or sets the tabindex of the RadSpell SpellCheck Button.

C#
public override short TabIndex { get; set; }
Property Value:

The tabindex of the RadSpell SpellCheck Button.

Overrides: RadWebControl.TabIndex

Gets the HtmlTextWriterTag value that corresponds to this Web server control. This property is used primarily by control developers.

C#
protected override HtmlTextWriterTag TagKey { get; }

Overrides: WebControl.TagKey

Gets or sets the value used to configure the spellchecker engine to ignore words containing: UPPERCASE, some CaPitaL letters, numbers; or to ignore repeated words (very very)

C#
public WordIgnoreOptions WordIgnoreOptions { get; set; }

Methods

Code moved into this method from OnPreRender to make sure it executed when the framework skips OnPreRender() for some reason

C#
protected override void ControlPreRender()

Overrides: RadWebControl.ControlPreRender()

C#
protected override void CreateChildControls()

Overrides: Control.CreateChildControls()

C#
protected override void DescribeClientEvents(IScriptDescriptor descriptor)
Parameters:descriptorIScriptDescriptor

Overrides: RadWebControl.DescribeClientEvents(IScriptDescriptor)

C#
protected override void DescribeClientProperties(IScriptDescriptor descriptor)
Parameters:descriptorIScriptDescriptor

Overrides: RadWebControl.DescribeClientProperties(IScriptDescriptor)

Executed when post data is loaded from the request

C#
protected override bool LoadPostData(string postDataKey, NameValueCollection postCollection)
Parameters:postDataKeystringpostCollectionNameValueCollectionReturns:

bool

Overrides: RadWebControl.LoadPostData(string, NameValueCollection)

C#
protected override void OnInit(EventArgs e)
Parameters:eEventArgs

Overrides: RadWebControl.OnInit(EventArgs)

C#
protected override void RenderContents(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadWebControl.RenderContents(HtmlTextWriter)