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

Repetitive appointement but one data

4 Answers 42 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Romain
Top achievements
Rank 1
Romain asked on 12 Jun 2013, 02:00 PM
Hi telerik and community
I've a problem with scheduler control. It's not a really problem but I don't know how i can do this trick.

I'm using radScheduler with entitydatasource and I would like to do this case.

For exemple in my DB I've one appointement from first june to first september and everyday at the same time.

Actually if i set the dataBegin and dataEnd the control rendering is an only one long appointement but I would like to see this same appointement every day at 16pm (for example) from 1june to 1september.

In fact this is not an appointement but playlist and in my DB i've the begin date the end date and the begin time and end time to play everyday

For example  : BeginDate : 1june EndDate 1september BeginTime 16pm EndTime 18pm

Hope someone understand me and help

Sincerly

4 Answers, 1 is accepted

Sort by
0
Romain
Top achievements
Rank 1
answered on 17 Jun 2013, 08:39 AM
Hello Telerik Team

I think that I'm beginning to find a solution of my scenario. I've to use RecurrenceRange but I don't really understand how I can use and configure this one with my scheduler bind to an entity.

Hope some one can help me

Regards

Thank you romain
0
Boyan Dimitrov
Telerik team
answered on 17 Jun 2013, 11:37 AM
Hello,
 
Indeed you can create an repetitive appointment staring from specific date and ending on specific date and occurring every day. Please take a look at our
online demo that demonstrates how you can populate your RadScheduler via EntityDataSource. The video here shows how you can create an appointment every day appointment staring on 1st of June and ending on 1st of September. 


Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Romain
Top achievements
Rank 1
answered on 17 Jun 2013, 12:18 PM
Thank you for your answer it'll certainly help me. But in my case, my appointments that I display in my scheduler control are created before in another page. So maybe i should do the recurrence by server ??? But how I can repeat appointment after they will be created ? On the databound maybe ?

There is my asp file.

<telerik:RadScheduler runat="server" ID="RadScheduler1" OnAppointmentDataBound="DataBound" Width="100%" DayEndTime="20:00:00" DataKeyField="IDTrackListSite" DataSubjectField="tbTrackList.Name" DataStartField="BeginDate"
DataEndField="EndDate" DataSourceID="EntityDataSource" Culture="fr-FR" ReadOnly="True">           
</telerik:RadScheduler>

In My case my appointment start on : 2013-05-10 End on : 2013-08-10 BeginTime : 8am EndTime 5pm. You can see the result with the attached file. But I would like the same result as your video example and just see the recurrence everyday

Thank Romain

Regards

0
Romain
Top achievements
Rank 1
answered on 18 Jun 2013, 09:51 AM
Finaly I found a solution on databound !

protected void DataBound(object sender, SchedulerEventArgs e)
{
    //Get DataItem
    var entity = EntityDataSourceExtensions.GetItemObject<tbTrackListSite>
       (e.Appointment.DataItem);
             
    //New Range
    RecurrenceRange range = new RecurrenceRange();
    //Set Start dateTime
    range.Start = e.Appointment.Start.Add((TimeSpan)entity.BeginTime);
    //Calcul the duration of the tracklist
    range.EventDuration = (TimeSpan)(entity.EndTime - entity.BeginTime);
    //Set the dateTime End
    range.RecursUntil = e.Appointment.End.Add((TimeSpan)entity.EndTime);
 
    //Create a daylyReccurence every day with the range
    DailyRecurrenceRule rule = new DailyRecurrenceRule(1, range);
    //Link rule to the current appointment
    e.Appointment.RecurrenceRule = rule.ToString();
             
}

You can see the result on the attached files


Cheers Romain ;)
Tags
Scheduler
Asked by
Romain
Top achievements
Rank 1
Answers by
Romain
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or