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

slot selection with dragging over the time slot area in ASP.NET MVC

2 Answers 125 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jan
Top achievements
Rank 1
Jan asked on 16 Nov 2010, 01:37 PM
Hello,

I really like your demo with slot selection with dragging over the time slot area, however I could not find the way how to use this functionality in ASP.NET MVC.
I'm using  OnClientTimeSlotContextMenuItemClicked="TimeSlotContextMenuItemClicked" event, but I can find only starttime in eventArgs. Can You please suggest me, how to obtain end time in selected slot area?


function TimeSlotContextMenuItemClicked(sender, eventArgs) {
  var type = eventArgs.get_item().get_value();
  var time = eventArgs.get_slot().get_startTime().format('dd/MM/yyyy H:mm');
}

radScheduler settings:

<telerik:RadScheduler runat="server" ID="RadScheduler1" AllowDelete="false" AllowEdit="true"  OnClientRequestFailed="requestFailed"  EnableExactTimeRendering="true"
           RowHeight="16px"  AllowInsert="false" MinutesPerRow="15" StartEditingInAdvancedForm="false"
           StartInsertingInAdvancedForm="false" OnClientAppointmentDoubleClick="OnClientAppointmentDoubleClick"
           OnClientTimeSlotContextMenuItemClicked="TimeSlotContextMenuItemClicked" OnClientTimeSlotClick="OnClientTimeSlotClick"
           OnClientAppointmentDeleting="OnClientAppointmentDeleting" OnClientAppointmentDataBound="OnClientAppointmentDataBound"
           Height="900px" OnClientAppointmentEditing="OnClientAppointmentEditing" OnClientAppointmentContextMenuItemClicked="appointmentContextMenuItemClicked"
           OnClientAppointmentContextMenu="OnClientAppointmentContextMenu"
           SelectedView="WeekView" DayHeaderDateFormat="dddd, dd MMMM yyyy" HoursPanelTimeFormat="HH:mm"
           OnClientAppointmentsPopulating="dataPopulating" OnClientAppointmentsPopulated="dataPopulated" Culture="cs-CZ">
            
           <AppointmentContextMenus>
               <%--The appointment context menu interaction is handled on the client--%>
               <%--See the JavaScript code above--%>
               <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu">
                   <Items>
                       <telerik:RadMenuItem Text="Export iCalendar" Value="GenerateVCal" ImageUrl="~/Content/Images/Icons/iCalendar16.png" />
                       <telerik:RadMenuItem IsSeparator="True" />
                       <telerik:RadMenuItem Text="Edit" Value="CommandEdit" ImageUrl="~/Content/Images/DataEditing/Edit.gif" />
                       <telerik:RadMenuItem Text="Delete"  Value="CommandDelete" ImageUrl="~/Content/Images/DataEditing/Delete.gif" Enabled="True" />
                   </Items>
               </telerik:RadSchedulerContextMenu>
           </AppointmentContextMenus>
           <TimeSlotContextMenus>
               <telerik:RadSchedulerContextMenu runat="server" ID="TimeSlotContextMenu">
                   <Items>
                       <telerik:RadMenuItem Text="CreateAppointment" Value="CreateAppointment"  />
                       <telerik:RadMenuItem Text="CreateTask" Value="CreateTask"  />
                       <telerik:RadMenuItem Text="CreateEmail" Value="CreateEmail"  />
                       <telerik:RadMenuItem Text="CreateCall" Value="CreateCall" />
                        <telerik:RadMenuItem Text="CreateTimesheet" Value="CreateTimesheet" />
                   </Items>
               </telerik:RadSchedulerContextMenu>
           </TimeSlotContextMenus>
           <TimelineView GroupBy="Calendar" GroupingDirection="Vertical" />
           <AdvancedForm Enabled="false" EnableResourceEditing="false" />
           <WebServiceSettings Path="~/Models/SchedulerWebService.asmx" ResourcePopulationMode="ClientSide" />
       </telerik:RadScheduler>
   </telerik:RadCodeBlock>

2 Answers, 1 is accepted

Sort by
0
Jan
Top achievements
Rank 1
answered on 18 Nov 2010, 04:20 PM
Hello,

I´m still lost, can You please suggest me something?

Thank You Jan
0
Nikolay Tsenkov
Telerik team
answered on 18 Nov 2010, 05:20 PM
Hi Jan,

You can get the duration of the selected area using the RadScheduler's method get_durationOfSelectedArea() which is sufficient to find the end time of the appointment.


Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jumpstart 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.
Tags
Scheduler
Asked by
Jan
Top achievements
Rank 1
Answers by
Jan
Top achievements
Rank 1
Nikolay Tsenkov
Telerik team
Share this question
or