<telerik:RadTextBox ID="TxtBx" Runat="server" TextMode="MultiLine">
</telerik:RadTextBox>
9 Answers, 1 is accepted
Which version of RadControls are you using? Is the problem reproduced on the online demos (which use the latest version)?
http://demos.telerik.com/aspnet-ajax/input/examples/radtextbox/firstlook/defaultcs.aspx
Sincerely yours,
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.
Regards,
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.
I am sorry, I don't see any problems with pasting inside RadTextBox in IE7 and RadControls 2009.3.1314. I tried pasting with right-clicking the mouse and with Ctrl-V - both worked.
Please provide a full runnable web page or modify the following until the issue is reproduced:
<%@ Page Language="C#" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
meta
http-equiv
=
"content-type"
content
=
"text/html;charset=utf-8"
/>
<
title
>RadControls</
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
/>
<
telerik:RadTextBox
ID
=
"RadTextBox1"
runat
=
"server"
MaxLength
=
"200"
TextMode
=
"MultiLine"
Width
=
"800px"
Height
=
"500px"
/>
</
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.
http://demos.telerik.com/aspnet-ajax/input/examples/radtextbox/firstlook/defaultcs.aspx
If you set Max length to 200 and try copy and pasting in the Multi-Line textbox it works for you?
That's right, it works. Tested with both the latest RadControls version and your version in IE7.
Sincerely yours,
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.
We found the issue had to do with a local administrative IE setting set by the internal IT department. Here is how you can replicate the behavior.
In IE go to Tools>internet Options> Security Tab. select the Internet zone and click on Custom Level. Scroll to near the bottom under the section called scripting. "Allow Programmatic clipboard access". Select Disable.
In IE go to http://demos.telerik.com/aspnet-ajax/input/examples/radtextbox/firstlook/defaultcs.aspx
Set Max Length: 100
In the Multi-Line: Textbox try to copy and paste some text.
It doesn't work.
In a Asp.Net TextBox control we don't have this issue.
It relates to setting the max length and Multi Line.
In order to support MaxLength for <textarea> elements (which normally do not have such a feature), we use programmatic access to the clipboard during paste operations.
In your case you can use the following workaround, which will probably be included in the next RadControls version, after some testing. The additional Javascript must be added to the page (or registered in an external JS file) in the <body>, not the <head>.
<%@ Page Language="C#" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
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:RadTextBox
ID
=
"RadTextBox1"
runat
=
"server"
MaxLength
=
"3"
TextMode
=
"MultiLine"
/>
<
script
type
=
"text/javascript"
>
if (typeof(Telerik) != "undefined" && typeof(Telerik.Web.UI.RadInputControl) != "undefined")
{
Telerik.Web.UI.RadInputControl.prototype._onTextBoxPasteHandler = function(e)
{
if (this.isMultiLine() && this._maxLength > 0)
{
if ($telerik.isSafari) // also Chrome
{
var thisObj = this;
window.setTimeout(function() { thisObj._textBoxElement.value = thisObj._textBoxElement.value.substr(0, thisObj._maxLength) }, 1);
}
else // IE
{
if (!e) var e = window.event;
var clipBoardAccessEnabled = true;
try
{
var clipString = window.clipboardData.getData("Text");
}
catch(e)
{
clipBoardAccessEnabled = false;
}
if (clipBoardAccessEnabled && clipString != "")
{
if (e.preventDefault) e.preventDefault();
var selection = this._textBoxElement.document.selection.createRange();
var length = this._maxLength - this._textBoxElement.value.length + selection.text.length;
var text = this._escapeNewLineChars(window.clipboardData.getData("Text"), "%0A").substr(0, length);
selection.text = text;
}
else
{
var thisObj = this;
window.setTimeout(function() { thisObj._textBoxElement.value = thisObj._textBoxElement.value.substr(0, thisObj._maxLength) }, 1);
}
}
}
}
}
</
script
>
</
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.