Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
149 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() 
    iftypeof(jQuery) != 'undefined' ) 
    { 
        jQuery("div.RadCalendar").each(function() { 
        if (this
        { 
            // find first INPUT child node 
            var obj = null
            forvar 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
82 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
115 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
191 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
327 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
2 answers
500 views
I'm using RadControls for ASP.NET AJAX Q2 2009. I have a RadGrid set up with a GridDateTimeColumn with the PickerType="DatePicker" and EditMode="InPlace".

    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" GridLines="None" 
        Width="100%" Height="175px" DataSourceID="odsDataSource" OnItemCreated="RadGrid1_ItemCreated" 
        ShowStatusBar="True" OnPreRender="RadGrid1_PreRender" OnItemInserted="RadGrid1_ItemInserted" 
        OnItemUpdated="RadGrid1_ItemUpdated" OnItemCommand="RadGrid1_ItemCommand" 
        OnInsertCommand="RadGrid1_InsertCommand"  
        OnUpdateCommand="RadGrid1_UpdateCommand" OnDeleteCommand="RadGrid1_DeleteCommand" 
        ClientSettings-Scrolling-AllowScroll="true" ClientSettings-Scrolling-SaveScrollPosition="true" 
        AllowAutomaticInserts="False" AllowAutomaticUpdates="False" AllowAutomaticDeletes="false" 
        Visible="False" HeaderStyle-Font-Size="XX-Small" HeaderStyle-Font-Bold="true" 
        Font-Size="XX-Small" TabIndex="50"
        <MasterTableView CommandItemDisplay="Top" CommandItemSettings-RefreshText="Refresh List" DataSourceID="odsDataSource" 
            ShowHeadersWhenNoRecords="true" NoMasterRecordsText="No Entries" EditMode="InPlace" 
            ItemStyle-Font-Size="XX-Small" Font-Size="XX-Small" EditItemStyle-Font-Size="XX-Small" 
            EditFormSettings-EditColumn-ItemStyle-Font-Size="XX-Small"
            <CommandItemSettings RefreshText="Refresh List"></CommandItemSettings> 
            <Columns> 
                            <telerik:GridEditCommandColumn ButtonType="LinkButton" EditText="Edit" CancelText="Cancel" 
                    UniqueName="EditColumn" ItemStyle-Font-Size="XX-Small"
                </telerik:GridEditCommandColumn> 
                 
                <telerik:GridDateTimeColumn DataField="CHECKER_DATE" HeaderText="Date" ReadOnly="false" 
                    UniqueName="CHECKER_DATE" ItemStyle-Font-Size="XX-Small" ColumnEditorID="CHECKER_DATE" 
                    Resizable="false" PickerType="DatePicker" DataFormatString="{0:MM/dd/yyyy}" MinDate="2007-10-01"
                </telerik:GridDateTimeColumn> 
            </Columns>             
<!-- Big grid. Other columns truncated to save space -->
        </MasterTableView> 
</telerik:RadGrid> 

When I click on a row's "Edit' link, the DatePicker shows the correct date from the database in both the box and in the calendar. However, when I click on "Insert" I want the current date to be selected and I can't seem to get that to happen.

In the codebehind page I have this method set up:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
     if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
     { 
           GridEditableItem item = e.Item as GridEditableItem; 
           if (e.Item.ItemIndex == -1) 
           {   
                (editedItem["CHECKER_DATE"].Controls[0] as RadDatePicker).SelectedDate = DateTime.Today
           } 
     } 

I have also tried it like this:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
{  
     if (e.Item is GridEditableItem && e.Item.IsInEditMode)  
     {  
           GridEditableItem item = e.Item as GridEditableItem;  
           if ((editedItem["CHECKER_DATE"].Controls[0] as RadDatePicker).SelectedDate.ToString().Length == 0) 
            {                
             editedItem["CHECKER_DATE"].Controls[0] as RadDatePicker).SelectedDate = DateTime.Today; 
            }  
     }  
}  

I have also tried editedItem["CHECKER_DATE"].Controls[0] as RadDatePicker).SelectedDate = DateTime.Now.Date; with no success.

I've tried some other methods which I've found on Telerik's web site and some other places and I can't seem to get this date to pre-select. 

Any ideas of what I can do to make this work.

Thanks in advance.
Elmer Boutin
Top achievements
Rank 2
 answered on 28 Oct 2009
1 answer
123 views
hello,

Can i create thumbnail image on the fly with BinaryImage ?
Sebastian
Telerik team
 answered on 28 Oct 2009
8 answers
172 views
I am trying to use the rad scheduler but when I change the view from say day to week (top right) I get a full postback rather than a nice
ajax update on the page, can someone advise please?

My code as follows:-

<
%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="PulsionTechnology.RefugeeCouncil.WebForm3" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
      
</head> 
<body class="BODY">  
    <form id="form1" runat="server">  
        <telerik:RadScriptManager runat="Server" ID="RadScriptManager1" /> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadScheduler1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> 
        <div class="bigModule">  
            <div class="bigModuleBottom">  
                In this example <strong>RadScheduler</strong> is bound to a custom provider - the  
                XmlSchedulerProvider.  
                <br /> 
                The provider uses an XML document for data storage.  
                <br /> 
                Please, refer to the documentation for the complete source code of the provider  
                and information about implementing your own providers.  
            </div> 
        </div> 
        <telerik:RadScheduler runat="server" ID="RadScheduler1" Width="750px" TimeZoneOffset="03:00:00" 
            SelectedDate="2007-03-30" DayStartTime="08:00:00" DayEndTime="18:00:00" OnDataBound="RadScheduler1_DataBound">  
            <AdvancedForm Modal="true" /> 
        </telerik:RadScheduler> 
    </form> 
</body> 
</html> 



And Code behind:-

using System;  
using System.Web.UI;  
using Telerik.Web.UI;  
 
 
namespace PulsionTechnology.RefugeeCouncil  
{  
    public partial class WebForm3 : System.Web.UI.Page  
    {  
        private const string ProviderSessionKey = "Telerik.Web.Examples.Scheduler.XmlSchedulerProvider.DefaultCS";  
 
        // You can safely ignore this method.  
        // Its purpose is to limit the changes to the underlying data only to the active user session.  
        protected void Page_Init(object sender, EventArgs e)  
        {  
            XmlSchedulerProvider provider;  
            provider = new XmlSchedulerProvider(Server.MapPath("~/App_Data/Appointments.xml"), false);  
            RadScheduler1.Provider = provider;  
        }  
 
        protected void Page_Load(object sender, EventArgs e)  
        {  
 
        }  
 
        protected void RadScheduler1_DataBound(object sender, EventArgs e)  
        {  
            // Turn off the support for multiple resource values.  
            foreach (ResourceType resType in RadScheduler1.ResourceTypes)  
            {  
                resType.AllowMultipleValues = false;  
            }  
        }  
    }  
 

Gregor Suttie
Top achievements
Rank 1
 answered on 28 Oct 2009
2 answers
137 views
Hi Telerik,

I use the Google Like filtering in my application. It works fine. But I need small changes.
When I first click on the Filter textbox, it loads everything from database and shows it in a Combo.
What I need is at the time of first click on the textbox it should not select any thing from database, because  there is heavy load to server, after typing something in that textbox then it should select from database.

So, how to do this. Please suggest.

Thanks,
Monalisa
Monalisa
Top achievements
Rank 1
 answered on 28 Oct 2009
1 answer
123 views
I have set my scheduler's ResourcePopulationMode to manual as described on this (broken link filled) page http://www.telerik.com/help/aspnet-ajax/telerik.web.ui-telerik.web.ui.schedulerwebservicesettings-resourcepopulationmode.html

I would like to find out what exactly I need to do to assign the resources correctly on page init.
Peter
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?