I'm using an older version of Telerik that doesn't have the ASP 4.0 fix and it's causing my grid control to throw an error when paging. The error is: Microsoft JScript runtime error: Object doesn't support property or method '_destroyTree'
I found a fix on these forums that works very well when used on a normal ASPX page...
<script type="text/javascript"> $telerik.disposeElement = function (element) { if (typeof (Sys.WebForms) == "undefined") return; var prm = Sys.WebForms.PageRequestManager.getInstance(); if (prm && prm._destroyTree) prm._destroyTree(element); else if (Sys.Application.disposeElement) Sys.Application.disposeElement(element, true); }; Telerik.Web.UI.RadComboBox.prototype._removeDropDown = function () { var slide = this.get_dropDownElement().parentNode; slide.parentNode.removeChild(slide); if (this._disposeChildElements) $telerik.disposeElement(slide); if (!$telerik.isSafari) slide.outerHTML = null; this._dropDownElement = null; }; </script>
My problems is that I am using user controls on much of the site. If I place this in the ASCX file, I get the same error as if I didn't have it there. If I place it in the ASPX that the user control is added to, I get this error: Microsoft JScript runtime error: Unable to get value of the property 'prototype': object is null or undefined most likely because the user control with the grid isn't loaded yet.
I can place the script inside an IF statement... if (Telerik.Web.UI.RadComboBox != null) { } and that gets rid of the prototype error, but it acts like the script isn't there because I still get the original _destroyTree error.
Can someone tell me what I need to do in order to make this work inside a user control? Here's the layout of my pages...
So what I need is to include the fix script in each user control that uses a grid so that I can page. If it were possible to include it on the master page so I don't have to put it on every user control, or if I could put it on the ASPX page that is in the first placeholder and have it work even when a new user control is loaded, then that would be great. But I don't mind including it in every user control if that is what's needed for this to work. I can also include a .JS file if that is what's needed. Keep in mind that these are inside an update panel, so the postback will be asynchronous in case that matters.
Any help would be greatly appreciated. It was decided that we wouldn't be updating Telerik, so I'm stuck with trying to make this work with just the script fix. This is really the only issue I'm having with Telerik and 4.0 with our site, so there isn't enough incentive to buy a newer version.
Just as a reminder, the script above works perfectly when used on a normal ASPX page that has the grid right on it rather than the grid being on a user control that is loaded later.
List<KI_Controls.KI_Multimedia> oPrimaryMM = oPrimaryContact.GetAllMultimedia();
BindingList<cKIWebMultiMediaContent> Populatelist = new BindingList<cKIWebMultiMediaContent>();
for (int i = 0; i < oPrimaryMM.Count; i++)
{
cKIWebMultiMediaContent otemp = new cKIWebMultiMediaContent();
otemp.MultiMediaType = oPrimaryMM[i].Multimedia_Type;
otemp.MultiMediaText = oPrimaryMM[i].Value;
Populatelist.Add(otemp);
}
gridMainMultimedia.DataSource = Populatelist;
| [ServiceContract(Namespace = "")] |
| [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] |
| [ServiceBehavior(IncludeExceptionDetailInFaults = true)] |
| public class Scheduler |
| { |
| private WebServiceAppointmentController _controller; |
| private WebServiceAppointmentController Controller |
| { |
| get |
| { |
| if (_controller == null) |
| { |
| _controller = |
| new WebServiceAppointmentController( |
| new XmlSchedulerProvider(HttpContext.Current.Server.MapPath("~/Content/Schedule.xml"), |
| false)); |
| } |
| return _controller; |
| } |
| } |
| [OperationContract] |
| public IEnumerable<AppointmentData> GetAppointments(SchedulerInfo schedulerInfo) |
| { |
| return Controller.GetAppointments(schedulerInfo); |
| } |
| [OperationContract] |
| public IEnumerable<AppointmentData> InsertAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData) |
| { |
| return Controller.InsertAppointment(schedulerInfo, appointmentData); |
| } |
| [OperationContract] |
| public IEnumerable<AppointmentData> UpdateAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData) |
| { |
| return Controller.UpdateAppointment(schedulerInfo, appointmentData); |
| } |
| [OperationContract] |
| public IEnumerable<AppointmentData> CreateRecurrenceException(SchedulerInfo schedulerInfo, |
| AppointmentData recurrenceExceptionData) |
| { |
| return Controller.CreateRecurrenceException(schedulerInfo, recurrenceExceptionData); |
| } |
| [OperationContract] |
| public IEnumerable<ResourceData> GetResources(SchedulerInfo schedulerInfo) |
| { |
| return Controller.GetResources(schedulerInfo); |
| } |
| } |
| <telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="Black" Visible="true" SelectedDate="2009-02-02" |
| Width="1043px"> |
| <Localization AdvancedAllDayEvent="All day"></Localization> |
| <AdvancedForm DateFormat="dd/MM/yyyy" TimeFormat="HH:mm"></AdvancedForm> |
| <WebServiceSettings Path="Service.svc" /> |
| </telerik:RadScheduler> |
EmployeeDetailsCS.ascx contains two list boxes with server side events (something like that: http://demos.telerik.com/aspnet-ajax/listbox/examples/serverside/serverevents/defaultcs.aspx). List boxes have have as a datasouce two list (let's say "employeeTasks" and "allTasks"), and every time i transferr an item those lists are updated and the database is updated too. I can't make a refresh to this "user control edit form" every time an item is transfered, to be able to see the new "content" of two lists. Any ideea how to do this?


1) Installing RadControls from ZIP file
using System.Web.UI;
using Telerik.Web.UI;
when I add the controls (this.Controls.Add(this.radEditor))the attached error appears.
Question: What exactly I need to do to start using RadControls?
Thank you for your help

<telerik:RadEditor runat="server" ID="RadEditor1"> <CssFiles> <telerik:EditorCssFile Value="~/ExternalCssFiles/Styles1.css" /> <telerik:EditorCssFile Value="~/ExternalCssFiles/Styles2.css" /> </CssFiles></telerik:RadEditor><telerik:RadEditor runat="server" ID="RadEditor1"> <CssFiles> <telerik:EditorCssFile Value="http://www.mysite.com/styles/Styles1.css" /> <telerik:EditorCssFile Value="http://www.mysite.com/styles/Styles2.css" /> </CssFiles></telerik:RadEditor>