Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
85 views
Hi all,

Currently, I have a combo box in a user control where the AllowCustomText property is set to true so that I can perform LoadOnDemand.  However, I have an issue with preventing special characters from being entered.  I looked at the article: http://www.telerik.com/help/aspnet-ajax/combo-prevent-typing-particular-characters.html.  Unfortunately, I have been having a difficult time trying to implement the suggestions in the article.  I tried to use the ClientScript methods from the page (ClientScript.RegisterClientStartupScript, etc) but to no avail.  

In addition, I tried to append to the page's onload with the following code snippet

Format Code Block(
if (window.addEventListener){
window.addEventListener('onload', 'someFunction', false);
}
else if (window.attachEvent){
window.attachEvent('onload', 'someFunction');
}
)

Also, I tried it with and without the quotes for someFunction.

Does anyone out there have any suggestions?

Thanks,

Ron
Veselin Vasilev
Telerik team
 answered on 28 Oct 2009
2 answers
105 views
Hi All,

I want to implement a scrolling playlist feature.  The idea is to have a button at the top and the bottom to scroll the list up or down.  See the attached screenshot.  I was thinking about using the RadListBox control, but I don't see a way to cause it to scroll (other than the mousewheel of course, and a side scroll bar).  What I'd really like is a configurable scrolling panel, that could go horizontally or vertically, that doesn't depend on Flash or SIlverlight.

Is there a better control for this?  Any suggestions on approach?

Thanks in advance,
Mike
Mike Sharp
Top achievements
Rank 1
 answered on 28 Oct 2009
2 answers
89 views
Hi, I have a code snippet:

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); 

in alert window i get [null] and script failed to load after radSlider.set_value(newValue * 10);

i tried use Jquery selector by id, but that returns bad object i think. I'm not very skilled in JavaScript, so don't laugh :)

radSlider I have defined with

<telerik:RadSlider ID="RadSlider1" runat="server"  OnClientValueChange="valueChanged" MinimumValue="3" MaximumValue="15"


Any ideas?







Jan
Top achievements
Rank 1
 answered on 28 Oct 2009
2 answers
93 views

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

Danny Scheelings
Top achievements
Rank 1
 answered on 28 Oct 2009
1 answer
124 views
Hi,

I need to set some properties of the editor at run-time such as the SpellCheckSettings-DictionaryPath and the ImageManager-ViewPaths
However I am not sure how to get a reference to the serve control?

Using version 2009.1.311.35

I have tried

1) http://www.telerik.com/help/aspnet-ajax/editor_getingreferencetoradeditor.html   client side but this does not seem to work and I am not sure I can even set these properties using JavaScript?

2) Adding code behind class to reference it.

Code behind
protected void Page_Load(object sender, EventArgs e) 
        { 
            RadEditor1.ImageManager-ViewPaths= this.ViewData["imagePath"].ToString(); 
        } 

Controller
public ActionResult Index( ) 
        { 
            ViewData["imagePath"] = "~/Content/RadEditor/mypics/1";  
            return View("Index"); 
        } 

View
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs"  Inherits="mynamespave.Index"  %> 

When I do this the editor does not appear at all and I get the following JavaScript error:
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

How do I set properties dynamically when using MVC?
Is their a new version MVC friendly version of the editor coming ?

Also

Why does this work
<
    RadEditor1.Content = (string)ViewData["Content"]"; 
%> 

but every other property appart from content seems not to work for example the below has no effect
<
    RadEditor1.EditModes = EditModes.Design; 
%> 



Rumen
Telerik team
 answered on 28 Oct 2009
1 answer
537 views
I want to populate the radwindow title at runtime e.g. on page_load. is it possible? please help , thanks in advance
Fiko
Telerik team
 answered on 28 Oct 2009
1 answer
98 views
Hi,

    Im using RadFileExplorer in a page where i need to have ImageEditor option that has been available in the ImageManager in RadEditor Control  or else is there anyway to use the ImageManager.ascx Control directly in a page and not as an dialog.

Thanks & Regards,
Alfred.
Fiko
Telerik team
 answered on 28 Oct 2009
1 answer
221 views
Hi there!

I have a RadEditor which have cientside validation of 4000 characters, my problem is the alert box message prompts when the characters exceeds 4000, but I can't set or change the text editor to maintain only its 4000 characters...

It seems that the code line > rtfEditor.set_text(oValue.substring(0, 30)); doesn't work.

Many Thanks!

Reynald


Here's the markup:

<

 

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>

 


Rumen
Telerik team
 answered on 28 Oct 2009
1 answer
153 views

 

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();

        }

    }

}

Tsvetoslav
Telerik team
 answered on 28 Oct 2009
9 answers
210 views
hi!

can help me with this error in IE:
in this page i got 3 RadEditors,  but in Firefox i dont have any problem!

Error white executing filter xhtml - typeError: 'getAttibute(...).length' es nulo o no es un objeto

Detalles de error de página web

Agente de usuario: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)
Fecha: Thu, 14 May 2009 14:33:46 UTC


Mensaje: Se esperaba ';'
Línea: 2
Carácter: 1
Código: 0
URI: http://localhost:1132/TeamCRM.v2.0/js/deziner/accordian.pack.js

Mensaje: 'undefined' es nulo o no es un objeto
Línea: 16300
Carácter: 1
Código: 0
URI: http://localhost:1132/TeamCRM.v2.0/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2008.2.723.20%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aes-ES%3a2d55bee4-231f-41bd-bb68-763425274f51%3a393f5085%3a9703c1f0%3aa3f85c94%3a6cfd3594%3a577694e5%3aa9723048%3a39249aa4%3a34f9d57d%3a526d426%3a9f00b839%3ab525c68b%3a70e0d5b9%3ad438be25%3a80c4ad6d
Rumen
Telerik team
 answered on 28 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?