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

Appointment showing in wrongslot in timelineview

3 Answers 44 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
rajesh
Top achievements
Rank 1
rajesh asked on 12 Mar 2012, 06:58 AM
Hi sir,
Iam using Radscheduler for my batch planner...In Time line View Appointment is showing in wrong slot as shown in attachment
batch no 143 starting from 6th  december but in timeline view appointment is showing from november Where as in other views i.e day view,month view... etc appointment is showing correctly.i traced it in appointment data bound event using debugger ...the appointment start time is showing correctly...but not dispalying correctly(only in timeline view) below is the code i written.


<telerik:RadScheduler runat="server" ID="RadScheduler1"  SelectedDate="01/01/2011" al <br>        SelectedView="TimelineView" DayEndTime="19:00:00" DataKeyField="BatchNo" DataDescriptionField="BatchNo" <br>        DataStartField="StartDate" DataEndField="EndDate" DataSubjectField="StartDate" <br>            OverflowBehavior="Expand" DataSourceID="DetailsDataSource" Height="" ReadOnly="true"><br>            <AdvancedForm Modal="false" /><br>             <AppointmentTemplate><br>            <asp:Label ID="Label2" Text="BatchNo:" runat="server"><%#  Eval("Description")%></asp:Label>&nbsp;&nbsp;<br>            <asp:Label ID="EndDate" Text="StartDate:" runat="server"><%#  Eval("Start").ToString().Split(' ')[0] %></asp:Label>&nbsp;&nbsp;<br>            <asp:Label ID="lblEnddate" runat="server"></asp:Label><br>             </AppointmentTemplate><br>            <ResourceTypes><br>                <telerik:ResourceType KeyField="BatchNo" Name="Batch" ForeignKeyField="BatchNo" TextField="BatchNo"<br>                    DataSourceID="DetailsDataSource"/><br>            </ResourceTypes><br>            <TimelineView UserSelectable="true" HeaderDateFormat="MMM-yyyy" ShowResourceHeaders="true" ShowInsertArea="false"  ReadOnly="true" SlotDuration="31:00:00"  ColumnHeaderDateFormat="MMM" NumberOfSlots="12" GroupBy="Batch" GroupingDirection="Vertical" /><br>            <MultiDayView UserSelectable="true" /><br>            <DayView UserSelectable="true" /><br>            <WeekView UserSelectable="true" /><br>            <MonthView UserSelectable="true" /><br>        </telerik:RadScheduler>
related events
protected void Page_Load(object sender, EventArgs e)<br>    {<br>        ClientScript.RegisterStartupScript(this.GetType(), "abc", "pageload();", true);//Registering client side page load function<br>        RadScheduler1.AppointmentDataBound += new Telerik.Web.UI.AppointmentDataBoundEventHandler(RadScheduler1_AppointmentDataBound);<br>        RadScheduler1.AppointmentCreated += new Telerik.Web.UI.AppointmentCreatedEventHandler(RadScheduler1_AppointmentCreated);<br>        RadScheduler1.SelectedDate = DateTime.Now.Date;<br>    }<br><br>    void RadScheduler1_AppointmentCreated(object sender, Telerik.Web.UI.AppointmentCreatedEventArgs e)<br>    {<br>        if (e.Appointment.ID != null)<br>        {<br>            Label Enddate = e.Container.FindControl("lblEnddate") as Label;<br>            Enddate.Text = "End date:" + e.Appointment.End.AddDays(-1).ToShortDateString();<br>        }<br>    }<br><br>   void RadScheduler1_AppointmentDataBound(object sender, Telerik.Web.UI.SchedulerEventArgs e)<br>    {<br>        if (e.Appointment.ID != null)<br>        {<br>            e.Appointment.ToolTip = "StartDate:" + e.Appointment.Start.ToShortDateString() + " " + "EndDate:" + e.Appointment.End.ToShortDateString();<br>          //  e.Appointment.End = e.Appointment.End.AddDays(1);<br>        }<br>    }
please give me a solution for this ASAP as it is already in production


Thanks
Rajesh


  

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 12 Mar 2012, 05:55 PM
Hi Rajesh,

 
I have reviewed the code and I have noticed that you have set the SlotDuration="31:00:00" and since not all of the months consist of 31 days this misalignment is expected.

A scenario in which each slot in the TimeLine View is equal to the appropriate month is not supported by RadScheduler.

All the best,
Plamen Zdravkov
the Telerik team
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 their blog feed now.
0
rajesh
Top achievements
Rank 1
answered on 12 Mar 2012, 06:30 PM
Thanks Plamen ,
I thought the same reason for that behaviour but cant i set respective  month days as  slot duration .I need this functionality to show entire year plan ,is there  any way  to implement that.Please give me solution as soon as possible



Thanks & Regards  
Rajesh
0
Plamen
Telerik team
answered on 15 Mar 2012, 04:12 PM
Hello Rajesh,

A possible workaround is to use several RadSchedulers in a way that each one of them represents a different month and they are connected as in this Code Library.

Hope this will be helpful.

All the best,
Plamen Zdravkov
the Telerik team
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 their blog feed now.
Tags
Scheduler
Asked by
rajesh
Top achievements
Rank 1
Answers by
Plamen
Telerik team
rajesh
Top achievements
Rank 1
Share this question
or