| function GetSlider() { |
| return $find("<%= RadSlider1.ClientID %>"); |
| } |
| var radSlider = GetSlider(); |
| alert(radSlider); |
| var newValue = $.cookie('site_font_size'); |
| newValue = newValue.substring(0, newValue.length-2) |
| radSlider.set_value(newValue * 10); |
| <telerik:RadSlider ID="RadSlider1" runat="server" OnClientValueChange="valueChanged" MinimumValue="3" MaximumValue="15"> |
Hi,
I'm using the example from http://demos.telerik.com/aspnet-ajax/dock/examples/dynamicdocks/defaultcs.aspx to dynamically add Docks to a DockZone. I set the CommandsAutoPostBack property of the Dock to False and also the AutoPostback property of the DockCommand to False, but I still notice a postback when I collapse/expand the Dock.
Is there a way to handle this client-side, and also with keeping state of the Docks after a postback?
Thanx,
Danny
| protected void Page_Load(object sender, EventArgs e) |
| { |
| RadEditor1.ImageManager-ViewPaths= this.ViewData["imagePath"].ToString(); |
| } |
| public ActionResult Index( ) |
| { |
| ViewData["imagePath"] = "~/Content/RadEditor/mypics/1"; |
| return View("Index"); |
| } |
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="mynamespave.Index" %> |
| Telerik.Web.UI.Editor is undefined |
| Telerik.Web.UI.Editor.CommandList... function(commandName, editor, args) {\r\n |
| a is undefined |
| Function.__typeName="Function";Function....Class("Sys.UI.Control",Sys.Component);\r\n |
| <% |
| RadEditor1.Content = (string)ViewData["Content"]"; |
| %> |
| <% |
| RadEditor1.EditModes = EditModes.Design; |
| %> |



<
telerik:RadEditor ID="EdtDesc" runat="server" SkinID="radEditor1Skin" OnClientLoad="LimitCharacters"
OnClientPasteHtml="OnClientPasteHtml">
</telerik:RadEditor>
<script type="text/javascript">
var editorList = new Object();
var editorLengthArray = [30, 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().trim().length;
if (textLength >= maxTextLength) {
alert(
'You are not able to type more than ' + maxTextLength + ' symbols!');
var rtfeditor = $find("<%=EdtDesc.ClientID %>");
var oValue = rtfeditor.get_text().trim();
rtfEditor.set_text(oValue.substring(0, 30));
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>

I believe a bug exists when using a GridDateTimeColumn DataType="System.TimeSpan" PickerType="TimePicker" DataFormatString="{0:t}" and then attempting UpdateValues in the code behind. UpdateValues fails because the value returning is DateTime instead of TimeSpan.
<telerik:GridDateTimeColumn DataType="System.TimeSpan" PickerType="TimePicker" DataFormatString="{0:t}" EditFormColumnIndex="2" HeaderText="End Time" DataField="TimeEnd" UniqueName="TimeEnd" />
void RadGrid_UpdateCommand(object source, GridCommandEventArgs e)
{
var editableItem = ((GridEditableItem)e.Item);
var id = (long)editableItem.GetDataKeyValue("Id");
using (DataContext context = new DataContext())
{
var frequencyLocation = context.FrequencyLocation.ByKey(id);
if (frequencyLocation != null)
{
editableItem.UpdateValues(frequencyLocation);
context.SubmitChanges();
}
}
}
