Hello Medac,
It is not clear whether you want the textbox value to
only appear uppercase or to actually
be uppercase. Check out the following example, which demonstrates both. The text-transform CSS style is used to make the textbox value appear uppercase, while the ValueChanging event is used to actually transform the value. No need to use keystroke events for that.
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
script
runat
=
"server"
>
protected void radtxtCarrierComments_TextChanged(object sender, EventArgs e)
{
Label1.Text = (sender as RadTextBox).Text;
}
</
script
>
<!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
>
<
style
type
=
"text/css"
>
.upper
{
text-transform:uppercase;
}
</
style
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
/>
<
telerik:RadTextBox
ID
=
"radtxtCarrierComments"
runat
=
"server"
CssClass
=
"upper"
AutoPostBack
=
"true"
OnTextChanged
=
"radtxtCarrierComments_TextChanged"
>
<
ClientEvents
OnValueChanging
=
"MyValueChanging"
/>
</
telerik:RadTextBox
>
<
script
type
=
"text/javascript"
>
function MyValueChanging(sender, args)
{
args.set_newValue(args.get_newValue().toUpperCase());
}
</
script
>
<
br
/><
br
/>
textbox value: <
asp:Label
ID
=
"Label1"
runat
=
"server"
/>
</
form
>
</
body
>
</
html
>
All the best,
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.