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

Need to get targetSlot for use in TimeSlotContextMenu

3 Answers 50 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jesse Lawler
Top achievements
Rank 1
Jesse Lawler asked on 09 Dec 2010, 11:56 PM
Seems like this should be so easy...

I'm defining a <TimeSlotContextMenus> tag within the body of my RadScheduler.  Within one of the functions callable from that menu, I need to be able to access the targetSlot at which the context menu actually appeared.  I tried adding a custom OnClientTimeSlotContextMenu to my page, but this function never seems to get called at all (although the context menu appears fine).  What's up?

<telerik:RadScheduler
    ID="RadSchedulerCalendarEvents"
    runat="server"
    Width="100%"
    Height="500"
    BorderStyle="None"
    BorderWidth="0"
    HoursPanelTimeFormat="h:mm tt"
    ShowFullTime="true"
    TimeSlotContextMenuSettings-EnableDefault="true"
    StartInsertingInAdvancedForm="true"
    DisplayRecurrenceActionDialogOnMove="true"
    EnableDatePicker="False"
    EnableDescriptionField="True"
    DataSourceID="SqlDataSourceEvents"
    DataKeyField="evtID"
    DataStartField="evtStartTime"
    DataEndField="evtEndTime"
    DataSubjectField="evtName"
    DataDescriptionField="evtDescription"
    DataReminderField="evtReminder"
    DataRecurrenceField="evtRecurrenceRule"
    DataRecurrenceParentKeyField="evtRecurrenceParentID"
    OnAppointmentDelete="RadSchedulerCalendarEvents_AppointmentDelete"
    OnAppointmentUpdate="RadSchedulerCalendarEvents_AppointmentUpdate"
    OnAppointmentInsert="RadSchedulerCalendarEvents_AppointmentInsert"
    OnClientAppointmentInserting="RadSchedulerCalendarEvents_OnClientAppointmentInserting"
    OnClientAppointmentEditing="RadSchedulerCalendarEvents_OnClientAppointmentEditing"
    OnClientAppointmentMoveEnd="RadSchedulerCalendarEvents_OnClientAppointmentMoveEnd"
    OnClientAppointmentResizeEnd="RadSchedulerCalendarEvents_OnClientAppointmentResizeEnd"
    >
    <AdvancedForm Modal="true" />
    <TimeSlotContextMenus>
        <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerTimeSlotContextMenu">
            <Items>
                <telerik:RadMenuItem Text="New Event" ImageUrl="/Images/Icons16x16/calendar.png" Postback="false" NavigateUrl="javascript: SwitchToCalendarEventInsertForm(null, null);" />
                <%--<telerik:RadMenuItem Text="New Recurring Event" ImageUrl="/Images/Icons16x16/recurring-event.png" NavigateUrl="javascript: alert('upmp');" />--%>
                <%--<telerik:RadMenuItem IsSeparator="true" />--%>
                <%--<telerik:RadMenuItem Text="Group by Calendar" Value="EnableGrouping" />--%>
                <telerik:RadMenuItem IsSeparator="true" />
                <telerik:RadMenuItem Text="Go to today" Value="CommandGoToToday" />
            </Items>
        </telerik:RadSchedulerContextMenu>
    </TimeSlotContextMenus>
    <AppointmentContextMenuSettings EnableDefault="true" />
    <Localization
        ContextMenuAddAppointment="New Event"
        ContextMenuAddRecurringAppointment="New Recurring Event"
        ContextMenuEdit="Edit Event" />
</telerik:RadScheduler>

3 Answers, 1 is accepted

Sort by
0
Jesse Lawler
Top achievements
Rank 1
answered on 15 Dec 2010, 09:16 PM
Anybody out there?  Telerik, please respond...  (Thanks!)
0
Accepted
Veronica
Telerik team
answered on 16 Dec 2010, 10:27 AM
Hi Jesse Lawler,

Please accept my apologies for the late reply.

The reason why OnClientTimeSlotContextMenu event does not fires is that it fires before the built-in context menu is shown (if it is enabled). As you are using your own context menu - the event will not be fired.
You can get the target slot in the handler of theOnClientTimeSlotContextMenuItemClicking event by the get_slot().

Hope this helps.

All the best,
Veronica Milcheva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Jesse Lawler
Top achievements
Rank 1
answered on 16 Dec 2010, 10:00 PM
Thanks, great!
Tags
Scheduler
Asked by
Jesse Lawler
Top achievements
Rank 1
Answers by
Jesse Lawler
Top achievements
Rank 1
Veronica
Telerik team
Share this question
or