Hello,
Browsers do not fire the "changed" event for textboxes, when their value is updated programmatically with Javasctript by using the textbox' value property. This is the reason why you need to call updateDisplayValue() explicitly after the spell check is finished.
You can fire the event manually, but in this case you will not be able to cancel it via the event arguments. Instead, you will have the previous value at your disposal and set it back with textBoxInstance.set_value().
<%@ Page Language="C#" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<
head
runat
=
"server"
>
<
meta
http-equiv
=
"content-type"
content
=
"text/html;charset=utf-8"
/>
<
title
>RadControls for ASP.NET AJAX</
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
/>
<
telerik:RadTextBox
ID
=
"RadTextBox1"
runat
=
"server"
>
<
ClientEvents
OnValueChanged
=
"MyValueChanged"
/>
</
telerik:RadTextBox
>
<
telerik:RadSpell
ID
=
"RadSpell1"
runat
=
"server"
ControlToCheck
=
"RadTextBox1"
ButtonText
=
"SpellCheck"
OnClientDialogClosed
=
"MyClientDialogClosed"
OnClientCheckStarted
=
"MyClientCheckStarted"
/>
<
script
type
=
"text/javascript"
>
var tbOldValue;
function MyClientCheckStarted(sender, args)
{
var tb = $find("RadTextBox1");
tbOldValue = tb.get_value();
}
function MyClientDialogClosed(sender, args)
{
var tb = $find("RadTextBox1");
var tbNewValue = tb.get_value();
tb.updateDisplayValue();
if (tbNewValue != tbOldValue)
tb.raise_valueChanged(tbNewValue, tbOldValue);
}
function MyValueChanged(sender, args)
{
alert("ValueChanged");
}
</
script
>
</
form
>
</
body
>
</
html
>
Greetings,
Dimo
the Telerik team