Hi –
I am using telerik Rad Controls in a .NET 2.0 application. There is an ASP.net page in application which consists of below controls.
<%@ Register Assembly="RadPanelbar" Namespace="Telerik.WebControls" TagPrefix="radp" %>
<%@ Register Assembly="RadMenu" Namespace="Telerik.WebControls" TagPrefix="radm" %>
<%@ Register Assembly="RadMultiPage" Namespace="Telerik.WebControls" TagPrefix="radMP" %>
<%@ Register Assembly="RadTabStrip" Namespace="Telerik.WebControls" TagPrefix="radTS" %>
<%@ Register TagPrefix="radA" Namespace="Telerik.WebControls" Assembly="RadAjax.Net2" %>
RadPanelbar.dll – version 3.5.2.0
RadMenu.dll – version 3.6.2.0
RadMultiPage.dll – version 1.5.2.0
RadTabStrip.dll – version 2.5.2.0
RadAjax.Net2.dll – version 1.8.4.0
The page contains a menu with few tabs. For each tab an asp.net web user control (.ascx) is loaded. The web user controls contains rad data grids and other rad & standard VS controls where data is fetched from a database. A Rad Ajax Manager is placed in the page to perform some validations. Rad Ajax Manager and Rad Ajax Panel is placed inside Web user controls to implement ajax functionality.
When loading this page a JavaScript error is thrown as “ ‘parentNode’ is null or not an object” for RadMenu_Global.js. The script error is thrown in RadMenu_Global.js. This does not occur all the time and it happens so rarely and because of that reason i have not been able to reproduce the issue to identify the problem.
Any idea’s to resolve this issue?
<telerik:GridTemplateColumn HeaderText="mycol" UniqueName ="temp1">
<ItemTemplate>
<asp:DropDownList ID="ddl" runat="server"></asp:DropDownList>
</ItemTemplate>
</telerik:GridTemplateColumn>
if
(e.Item is GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
DropDownList ddl1 = (DropDownList)item["temp1"].FindControl("ddl");
ddl1.DataSourceID = ?
ddl1.DataTextField =?
ddl1.DataValueField =?
ddl1.DataBind();
}
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%
@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml" >
<
head runat="server">
<title>Untitled Page</title>
</
head>
<
body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadScheduler1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadScheduler ID="RadScheduler1"
runat="server"
AllowDelete="True"
AllowEdit="True"
AllowInsert="True"
DataEndField="End"
DataKeyField="ID"
DataRecurrenceField="RecurrenceRule"
DataRecurrenceParentKeyField="RecurrenceParentID"
DataSourceID="SqlDataSource1"
DataStartField="Start"
DataSubjectField="Subject"
HoursPanelTimeFormat="h:mm tt"
SelectedDate="2007-11-29" OnAppointmentInsert="RadScheduler1_AppointmentInsert">
</telerik:RadScheduler>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SchedulerDataConnectionString %>"
DeleteCommand="DELETE FROM [Appointments] WHERE [ID] = @ID" InsertCommand="INSERT INTO [Appointments] ([Subject], [Start], [End], [UserID], [RoomID], [RecurrenceRule], [RecurrenceParentID], [Annotations]) VALUES (@Subject, @Start, @End, @UserID, @RoomID, @RecurrenceRule, @RecurrenceParentID, @Annotations)"
SelectCommand="SELECT [ID], [Subject], [Start], [End], [UserID], [RoomID], [RecurrenceRule], [RecurrenceParentID], [Annotations] FROM [Appointments]"
UpdateCommand="UPDATE [Appointments] SET [Subject] = @Subject, [Start] = @Start, [End] = @End, [UserID] = @UserID, [RoomID] = @RoomID, [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID, [Annotations] = @Annotations WHERE [ID] = @ID">
<DeleteParameters>
<asp:Parameter Name="ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Subject" Type="String" />
<asp:Parameter Name="Start" Type="DateTime" />
<asp:Parameter Name="End" Type="DateTime" />
<asp:Parameter Name="UserID" Type="Int32" />
<asp:Parameter Name="RoomID" Type="Int32" />
<asp:Parameter Name="RecurrenceRule" Type="String" />
<asp:Parameter Name="RecurrenceParentID" Type="Int32" />
<asp:Parameter Name="Annotations" Type="String" />
<asp:Parameter Name="ID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Subject" Type="String" />
<asp:Parameter Name="Start" Type="DateTime" />
<asp:Parameter Name="End" Type="DateTime" />
<asp:Parameter Name="UserID" Type="Int32" />
<asp:Parameter Name="RoomID" Type="Int32" />
<asp:Parameter Name="RecurrenceRule" Type="String" />
<asp:Parameter Name="RecurrenceParentID" Type="Int32" />
<asp:Parameter Name="Annotations" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function
OnDateSelected(sender, args)
{
var date = new Date(args.Date[0], (args.Date[1]-1), args.Date[2]);
$get(
"TextBox2").value += date.format("yyyy/MM/dd");
$get(
"TextBox2").value += " ";
$find(
"PopEx2").hidePopup();
}
function
pageLoad()
{
$find(
'PopEx').hidePopup();
}
</script>
</telerik:RadCodeBlock>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="lblSelectDate" runat="server" Text="Enter Date Range"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server">
</asp:TextBox>
<telerik:RadCalendar ID="RadCalendar1" runat="server" AutoPostBack="true" OnSelectionChanged="RadCalendar1_SelectionChanged">
</telerik:RadCalendar>
<cc1:PopupControlExtender ID="PopEx" runat="server" TargetControlID="TextBox1"
PopupControlID="RadCalendar1" Position="Bottom" />
</ContentTemplate>
</
asp:UpdatePanel>
</form>
</
body>
</
html>
Code Behind --------------------------------------------
protected void RadCalendar1_SelectionChanged(object sender, Telerik.Web.UI.Calendar.SelectedDatesEventArgs e)
{
TextBox1.Text +=
String.Format("{0} ", e.SelectedDates[e.SelectedDates.Count - 1].Date.ToString("yyyy/MM/dd"));
}