1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Should I have RadScheduler?

Should I have RadScheduler?

2 posts, 0 answered
  1. Eric Zanol
    Eric Zanol avatar
    13 posts
    Registered:
    15 Mar 2011
    17 Apr 2011
    Link to this post
    I've got a license for SF4 Standard. I don't see RadScheduler in the RadControls toolbox that I can enable through the administration settings. What I really need is to show a calendar view of events on my site, and this is not possible with the Events control or the RadCalendar control (which doesn't make much sense in the first place) and from cruising the forums I *think* I might be able to achieve what I need to with RadScheduler.

    So should it be in the set of RadControls that come with SF4?

    Thanks!
    Eric
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    18 Apr 2011
    Link to this post
    Hello Eric,

    You can use the fluent API to populate the RadScheduler appointments.

    There are two facades that you can use

    1. Event - this is used when you want to work with a single item
    2. Events - this is used when you want to work with multiple items

    sample

    var eventitems = App.WorkWith().Events().Get().ToList();

    You can take a look at Sitefinity 4.0 Developer Manual and  How to create a widget

    You need to create a custom widget that inherits from SimpleView or CompositeControl
    When you inherit from SimpleView there is a property LayoutTemplateName which gets the name of the embedded layout template.
    You should create a template for your control where you have RadScheduler declared.

    sample

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

    <telerik:RadSchedulerID="eventsSchedule"runat="server"  Skin="WebBlue"Width="500"Height="500">

    <AppointmentContextMenuSettingsEnableDefault="true"/>

    <TimeSlotContextMenuSettingsEnableDefault="true"/>

    </telerik:RadScheduler>

    In your custom class that inherits from SimpleView you need to create a control reference to the control in your template

    protected virtual RadSchedulerEventsScheduler
     
    {
     
        get
     
        {
     
            returnthis.Container.GetControl<RadScheduler>("eventsSchedule", true);
     
        }
     
    }

    verride InitializeControls method of SimpleView and create the datasource for the EventsScheduler
    You should also subscribe for AppointmentCreated event.

    EventsScheduler.AppointmentCreated += newAppointmentCreatedEventHandler(EventsScheduler_AppointmentCreated);


    Inside the event you can render the event item that is part of the datasource of the EventsScheduler control

    private void EventsSchedule_AppointmentCreated(objectsender, AppointmentCreatedEventArgs e)
       {
      
           var eventsManager = EventsManager.GetManager;
           Telerik.Sitefinity.Events.Model.Event_event = eventsManager.GetEvent(newGuid(e.Appointment.ID.ToString()));
     
           if(_event != null)
           {
     
               HyperLink eventDetailsLink = (HyperLink)e.Container.FindControl("eventDetailsLink");
               if(eventDetailsLink != null)
     
               {
                   eventDetailsLink.Text = e.Appointment.Subject;
                   eventDetailsLink.ToolTip = _event.ContentItem.Content.ToString();
                   eventDetailsLink.NavigateUrl = "some url here";
     
               }
           }
     
       }


    Please follow How to create a widget  tutorial and you can download the SDK  where you will find samples.




    Kind regards,
    Ivan Dimitrov
    the Telerik team

2 posts, 0 answered