Dynamic Time Slices for Hour

Sep 25, 2008 at 12:06 PM
How can I have 4 times slices for each hour that each slice will represent 15 minutes.

Regards
Dec 2, 2009 at 12:27 PM

Change the following lines:

 

DayView.cs(28):            scrollbar.Value = (startHour * 2 * appointmentSlotHeight * 2);
DayView.cs(993):            if ((hour > 0) && (hour < 24 * 2 * 2))
DayView.cs(994):                date = date.AddMinutes((hour * 30 / 2));
DayView.cs(1019):            startY = (start.Hour * appointmentSlotHeight * 2 * 2) + ((start.Minute * appointmentSlotHeight) * 2 / 30);
DayView.cs(1020):            endY = (end.Hour * appointmentSlotHeight * 2 * 2) + ((end.Minute * appointmentSlotHeight) * 2 / 30);
DayView.cs(1040):            if ((startHour * 2 * appointmentSlotHeight * 2) > scrollbar.Maximum) //maximum is lower on larger forms
DayView.cs(1046):                scrollbar.Value = (startHour * 2 * appointmentSlotHeight * 2);
DayView.cs(1262):            for (int m_Hour = 0; m_Hour < 24 * 2; m_Hour++)
DayView.cs(1266):                hourRectangle.Y = rect.Y + (m_Hour * 2 * appointmentSlotHeight * 2) - scrollbar.Value;
DayView.cs(1335):            for (int hour = 0; hour < 24 * 2 * 2; hour++)
DayView.cs(1388):                for (int halfHour = 0; halfHour < 24 * 2 * 2; halfHour++)
DayView.cs(1517):            HalfHourLayout[] appLayouts = new HalfHourLayout[24 * 2 * 2];
DayView.cs(1526):                int firstHalfHour = appointment.StartDate.Hour * 2 * 2 + (appointment.StartDate.Minute * 2 / 30);
DayView.cs(1527):                int lastHalfHour = appointment.EndDate.Hour * 2 * 2 + (appointment.EndDate.Minute * 2 / 30);
DayView.cs(1532):                    if (lastHalfHour < 24 * 2 * 2)
DayView.cs(1545):                        layout.Appointments = new Appointment[20];
DrawTool.cs(30):                    ////m_Time = m_Time.AddMinutes(30 / 2); // Fixed bug for incorrect selection that starts from bottom to top
DrawTool.cs(35):                        m_DayView.SelectionEnd = m_SelectionStart.AddMinutes(15);
DrawTool.cs(39):                        m_DayView.SelectionEnd = m_Time.AddMinutes(15); // Fixed bug for incorrect selection that starts from bottom to top
DrawTool.cs(74):                m_DayView.SelectionEnd = m_SelectionStart.AddMinutes(30 / 2);

Jul 20, 2010 at 8:22 PM

Hi!! I'm Leo from Argentina. Sorry for my bad english. I need to do the same as capsfast. I tried changing the lines of the original control for the ones in the post above, but i still have a problem: the control shows only the 12 first hours, and i need the 24 hours of the day. I'd be very gratefull if someone can help me with this. I haven't found any control as good as this one. Regards

 

Leonardo González

Aug 7, 2010 at 2:15 PM
Edited Aug 7, 2010 at 2:15 PM
leog_cba wrote:

Hi!! I'm Leo from Argentina. Sorry for my bad english. I need to do the same as capsfast. I tried changing the lines of the original control for the ones in the post above, but i still have a problem: the control shows only the 12 first hours, and i need the 24 hours of the day. I'd be very gratefull if someone can help me with this. I haven't found any control as good as this one. Regards

 

Leonardo González

In DayView.cs (1031)

        private void AdjustScrollbar()
        {
            scrollbar.Maximum = (4 * halfHourHeight * 25) - this.Height + this.HeaderHeight;
            scrollbar.Minimum = 0;
        }

Or check this diff for a more elegant solution.

http://calendar.codeplex.com/SourceControl/changeset/changes/23877

Sep 9, 2010 at 3:33 AM
Thanks for your answer. The version in the link works perfect. Regards.
Leonardo González

From: [email removed]
Sent: Sunday, August 08, 2010 9:30 PM
To: [email removed]
Subject: Re: Dynamic Time Slices for Hour [calendar:36452]

From: gerardpg

leog_cba wrote:

Hi!! I'm Leo from Argentina. Sorry for my bad english. I need to do the same as capsfast. I tried changing the lines of the original control for the ones in the post above, but i still have a problem: the control shows only the 12 first hours, and i need the 24 hours of the day. I'd be very gratefull if someone can help me with this. I haven't found any control as good as this one. Regards

Leonardo González

In DayView.cs (1031)

private void AdjustScrollbar()
{
scrollbar.Maximum = (4 * halfHourHeight * 25) - this.Height + this.HeaderHeight;
scrollbar.Minimum = 0;
}

Or check this diff for a more elegant solution.

http://calendar.codeplex.com/SourceControl/changeset/changes/23877