<telerik:RadEditor ID="EdtDesc" runat="server" EditModes="Design" OnClientLoad="LimitCharacters"
OnClientPasteHtml="OnClientPasteHtml" >
<Languages>
<telerik:SpellCheckerLanguage Code="en-US" Title="English" />
</Languages>
<Tools>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="Undo" />
<telerik:EditorTool Name="Redo" />
<telerik:EditorSeparator Visible="true" />
<telerik:EditorTool Name="Bold" />
<telerik:EditorTool Name="Italic" />
<telerik:EditorTool Name="Underline" />
<telerik:EditorSeparator Visible="true" />
<telerik:EditorTool Name="JustifyLeft" />
<telerik:EditorTool Name="JustifyCenter" />
<telerik:EditorTool Name="JustifyRight" />
<telerik:EditorTool Name="JustifyFull" />
<telerik:EditorSeparator Visible="true" />
<telerik:EditorTool Name="AjaxSpellCheck" />
</telerik:EditorToolGroup>
</Tools>
<Modules>
<telerik:EditorModule Name="RadEditorStatistics" />
</Modules>
</telerik:RadEditor>
<script type="text/javascript">
var editorList = new Object();
var editorLengthArray = [4000, 30];
var counter = 0;
function isAlphaNumericKey(keyCode) {
if ((keyCode > 47 && keyCode < 58) || (keyCode > 64 && keyCode < 91)) {
return true;
}
return false;
}
function LimitCharacters(editor) {
editorList[editor.get_id()] = editorLengthArray[counter];
counter++;
editor.attachEventHandler("onkeydown", function(e) {
e = (e == null) ? window.event : e;
if (isAlphaNumericKey(e.keyCode)) {
var maxTextLength = editorList[editor.get_id()];
textLength = editor.get_text().length;
if (textLength >= maxTextLength) {
alert('You are not able to type more than ' + maxTextLength + ' symbols!');
e.returnValue = false;
}
}
});
var element = document.all ? editor.get_document().body : editor.get_document();
$telerik.addExternalHandler(element, "paste", function(e) {
e = (e == null) ? window.event : e;
var maxTextLength = editorList[editor.get_id()];
textLength = editor.get_text().length;
var clipboardLength = window.clipboardData.getData("Text").length;
textLength += clipboardLength;
if (textLength >= maxTextLength) {
alert('You are not able to type more than ' + maxTextLength + ' symbols!');
e.returnValue = false;
return false;
}
});
}
function CalculateLength(editor, value) {
var textLength = editor.get_text().length;
var clipboardLength = value.length;
textLength += clipboardLength;
return textLength;
}
function OnClientPasteHtml(editor, args) {
var maxTextLength = editorList[editor.get_id()];
var commandName = args.get_commandName();
var value = args.get_value();
if (commandName == "PasteFromWord"
|| commandName == "PasteFromWordNoFontsNoSizes"
|| commandName == "PastePlainText"
|| commandName == "PasteAsHtml"
|| commandName == "Paste") {
var textLength = CalculateLength(editor, value);
if (textLength >= maxTextLength) {
alert('You are not able to type more than ' + maxTextLength + ' symbols!');
args.set_cancel(true);
}
}
}
</script>
Hope to find a solution,
Many Thanks!!

{Sys.UI.Control.initializeBase(
this);this._element=a;a.control=this}
If I place the tooltip outside the panel it's possible to make postbacks inside the tooltip. But then everything stops working when a postback is made in the outermost panel.
<
asp:Panel ID="pnlProducts" runat="server" style="display:inline">
<asp:TextBox ID="txtProductID" runat="server" Width="50" MaxLength="8"></asp:TextBox>
<
telerik:RadToolTip ID="RadToolTip1" runat="server" Animation="None" ContentScrolling="None" ShowEvent="OnClick" HideEvent="ManualClose" Width="370" Height="150" ShowDelay="0" HideDelay="0" TargetControlID="txtProductID">
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Do postback" CausesValidation="false" />
</telerik:RadAjaxPanel>
</
telerik:RadToolTip>
</asp:Panel>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="pnlProducts">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="pnlProducts" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
| <Telerik:RadTreeView ID="RadTreeView2" runat="server" Visible="true" Runat="server" Skin="Default" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="true" EnableEmbeddedScripts="true"></Telerik:RadTreeView> |
