Hi Lukasz,
I am afraid the described behavior is not supported out-of-the-box - the RadNumericTextBox accepts only one type of decimal separator, according to its culture and settings.
Manipulating the clipboard data is not allowed due to security restrictions, so I suggest you the following.
Depending on the control's decimal separator, you may need to reverse the Javascript logic (e.g. replace "." with "," or vice-versa)
<%@ 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</
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
/>
<
telerik:RadNumericTextBox
ID
=
"RadNumericTextBox1"
runat
=
"server"
>
<
NumberFormat
AllowRounding
=
"false"
DecimalDigits
=
"0"
GroupSeparator
=
" "
/>
<
ClientEvents
OnValueChanging
=
"MyValueChanging"
/>
</
telerik:RadNumericTextBox
>
<
br
/><
br
/>
8.5
<
br
/>
8,5
<
script
type
=
"text/javascript"
>
var textboxFlag = true;
function MyValueChanging(sender, args)
{
if (!textboxFlag)
return;
var v = sender._textBoxElement.value;
if (v.indexOf(",") != -1)
{
textboxFlag = false;
var vn = v.replace(",", ".");
sender._textBoxElement.value = vn;
window.setTimeout(function(){sender.set_value(vn);textboxFlag = true;}, 1);
}
}
</
script
>
</
form
>
</
body
>
</
html
>
Best wishes,
Dimo
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.