Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
548 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
106 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
228 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
156 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
220 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
1 answer
161 views
I ran into problem that RadDateTimePicker client object method "hidePopup" or "hideTimePopup" threw an error message: "'get_calendar()' is null or not an object".

Here is my code piece:
function HideAllCalendars() 
{ 
    if( typeof(jQuery) != 'undefined' ) 
    { 
        jQuery("div.RadCalendar").each(function() { 
        if (this) 
        { 
            // find first INPUT child node 
            var obj = null; 
            for( var i = 0; i < this.childNodes.length; i++ ) 
            { 
                var node = this.childNodes[ i ]; 
                if( node.tagName == 'INPUT' && node.id ) 
                { 
                    obj = node; 
                    break; 
                } 
            } 
            if( obj ) 
            { 
                var oo = $find(obj.id) 
                if(oo && oo.hidePopup && oo.hideTimePopup) 
                { 
                    oo.hidePopup(); 
                    oo.hideTimePopup(); 
                } 
            } 
        } 
        }); 
    } 
} 

The oo.hidePopup or oo.hideTimePopup will throw the error message. Here is the exact error in the Telerik resource file:
for(var _32 in Telerik.Web.UI.RadDatePicker.PopupInstances){ 
if(Telerik.Web.UI.RadDatePicker.PopupInstances.hasOwnProperty(_32)){ 
var _33=Telerik.Web.UI.RadDatePicker.PopupInstances[_32].Opener; 
this._hideFastNavigationPopup(_33); 
Telerik.Web.UI.RadDatePicker.PopupInstances[_32].Hide(); 
} 
} 
},_hideFastNavigationPopup:function(_34){ 
if(_34){ 
var _35=_34.get_calendar()._getFastNavigation().Popup; //Error Happens here! 
if(_35&&_35.IsVisible()){ 
_35.Hide(true); 
} 
} 
},_setInputDate:function(_36){ 
this._dateInput.set_selectedDate(_36); 
},_getJavaScriptDate:function(_37){ 
var _38=new Date(); 
_38.setFullYear(_37[0],_37[1]-1,_37[2]); 
 

Why does the error happen? please help. Thanks.
O'Man
Top achievements
Rank 1
 answered on 28 Oct 2009
1 answer
88 views
Hi
     I have used Telerik Rad Ajax controls version Q2 2008.
     
     I have used Line Rad chart & developed  drill-down functionality on line chart's points. But when any one point of the line overlap with another line that time drill-down functionality not working. Please give your reply.

Thanks

Velin
Telerik team
 answered on 28 Oct 2009
2 answers
122 views
I have a RadGrid with 3 columns in the master table only: 2 are read only and the other is an EditTemplate with a RadTextBox.  If in edit or insert mode and after the value of the textbox changes and loses focus, I want to do an AJAX call which will query the database for the newly entered value and then populate the 2 read only fields from the results.  So to the user, the 2 read only fields appear to get "auto populated" after the value of the textbox changes.  Is this possible?  All I really need help with is getting the textbox to call a sub in the codebehind.  I should be able to take it from there.

Thanks!
Rob
Top achievements
Rank 1
 answered on 28 Oct 2009
3 answers
197 views
Hi,

Incredibly stupid question here but how do i get the window to close when I click a button within it instead of clicking the red x at the top right.

I was looking for a me.close() or something equivalent.

Thks,

Phil
Luis
Top achievements
Rank 1
 answered on 28 Oct 2009
3 answers
338 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.
Hope I can find solution for this one.

Many Thanks!

Reynald


Here's my 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>


reynald lawrence
Top achievements
Rank 1
 answered on 28 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?