This is a migrated thread and some comments may be shown as answers.

Context Menu Null Reference

1 Answer 13 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Ed asked on 15 Jul 2014, 01:34 PM
I have an interesting, but not funny, situation with the RadScheduler. In a nutshell, I am using context menus for the Appointments and Time Slots. My issue is with the Appointment context menu. Looking at the attached aspx page, you will notice that the data source for the scheduler is controlled by one of the combo boxes. When first entering the page, everything works as expected. However, after changing the selected item on the combobox, the Appointment context menu fails (I believe it is in the showAt method) when the following error is recorded: Unable to get property 'parentNode' of undefined or null reference. This leaves the property, _shown, set to true which means that, the next time you try to open the menu, it thinks it is already open and tries to close it, which also fails.

The scheduler is defined as:

<telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="EndOn" DataKeyField="ScheduleId"
DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrentParentId"
DataSourceID="ScheduleDataSource" DataStartField="StartOn" DataSubjectField="Subject"
DayStartTime="06:00:00" MinutesPerRow="60" SelectedView="MonthView" StartInsertingInAdvancedForm="True"
Width="1000px" ShowViewTabs="False" Height="580px"
OnNavigationCommand="RadScheduler1_NavigationCommand" OnClientFormCreated="OnClientFormCreated"
ShowFooter="False" RowHeight="20px" OnAppointmentDelete="RadScheduler1_AppointmentDelete"
OnAppointmentInsert="RadScheduler1_AppointmentInsert" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate"
OnClientAppointmentMoveStart="RadScheduler1_AppointmentMoveStart" OnOccurrenceDelete="RadScheduler1_OccurrenceDelete"
AllowEdit="False" OnFormCreating="RadScheduler1_FormCreating"
<Pdf PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in" PageTopMargin="1in" />
<AdvancedForm Modal="True" />
<telerik:RadSchedulerContextMenu runat="server" ID="AppointmentContextMenu">
<telerik:RadMenuItem Text="Delete" Value="CommandDelete" />
<telerik:RadMenuItem Text="Execution Summary" Value="Summary" />
<telerik:RadMenuItem Text="View Commands" Value="Commands" />
<telerik:RadSchedulerContextMenu runat="server" ID="TimeSlotContextMenu">
<telerik:RadMenuItem Text="New Calendar/Event" Value="CommandAddAppointment" />
<telerik:RadMenuItem Text="New Recurring Calendar/Event" Value="CommandAddRecurringAppointment" />
<telerik:ResourceType DataSourceID="CalendarDataSource" ForeignKeyField="CalendarId"
KeyField="CalendarId" Name="Calendar" TextField="Name" />
<telerik:ResourceType DataSourceID="EventDataSource" ForeignKeyField="EventId" KeyField="EventId"
Name="Event" TextField="Name" />
<Localization ConfirmRecurrenceDeleteSeries="Delete this and all future occurrences." />
<TimelineView NumberOfSlots="7" />
<WeekView DayStartTime="06:00:00" />
<MultiDayView DayStartTime="06:00:00" />
<MonthView FirstDayHeaderDateFormat="d MMM" />

The data source is defined as:

<asp:LinqDataSource ID="ScheduleDataSource" runat="server" ContextTypeName="EnterpriseWeb.DataContracts.Scheduling.SchedulingDataContext"
EntityTypeName="" TableName="ScheduleHeaderRows" EnableDelete="True" EnableInsert="True"
EnableUpdate="True" Where="GroupID == @GroupID" OnInserting="ScheduleDataSource_Inserting"
<asp:ControlParameter ControlID="GroupComboBox" DefaultValue="0" Name="GroupId" PropertyName="SelectedValue"
Type="Int16" />

The method for opening the menu is:

function RadScheduler1_AppointmentContextMenu(sender, args)
SelectedAppointment = args.get_appointment();

Unfortunately, I will not be able to provide any data for testing.

1 Answer, 1 is accepted

Sort by
Boyan Dimitrov
Telerik team
answered on 18 Jul 2014, 08:53 AM

I have noticed that you already opened a support ticket for the same problem. I would suggest continuing our communication in #840500 in order to avoid any confusions.

Boyan Dimitrov

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Asked by
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question