|
Hello,
I also need a default interval (15 min) on the "day-calendar". How can we implement this? Are there special functions in C#?
Do you know how can I mark selected days in month calendar with a colour-bar(like in outlook style)?
Thanks.
|
|
|
|
|
I also would like it to support a 15 min resolution too..
To do it, I think the following functions need to be modified:
GetTimeAt(e.X, e.Y); //must return DateTimes with minute 15 and 45 too for selection and draw tool etc.
Dayview.cs: DrawAppointments // half hour for-loop must be quaterhour
Dayview.cs: GetMaxParalelAppointments //must calculate and return quaterHourLayout[]
I think that is pretty much it..? But of course more might turn up in anyone actually tries to implement this.. missing features or new bugs might turn up..
|
|
|
|
|
Hello,
thank's for your suggestion.
GetTimeAt(e.X, e.Y); //must return DateTimes with minute 15 and 45 too for selection and draw tool etc.
Do you mean this function? Dayview.cs: public DateTime GetTimeAt(int x, int y)
What does it mean in source code?
I have changed following parameters in functions:
private HalfHourLayout[] GetMaxParalelAppointments(List<appointment> appointments)
HalfHourLayout[] appLayouts = new HalfHourLayout[24 * 4];
private void DrawAppointments(PaintEventArgs e, Rectangle rect, DateTime time)
for (int halfHour = 0; halfHour < 24 * 4; halfHour++)
private void DrawDay(PaintEventArgs e, Rectangle rect, DateTime time)
for (int hour = 0; hour < 24 * 4; hour++)
private void DrawHourLabels(PaintEventArgs e, Rectangle rect)
hourRectangle.Y = rect.Y + (m_Hour * 4 * halfHourHeight) - scrollbar.Value;
private void AdjustScrollbar()
scrollbar.Maximum = (2 * (halfHourHeight - 1) * 51) - this.Height + this.HeaderHeight;
The problem is that I cannot mark days from 11:45-0:00. Do you know what the problem could be?
|
|
|
|
|
Can you mark days from 11:45-16:15 then?
The problem with marking to 00:00 is also in the 30 minute version.
The thing is that 00:00 is actually the next day.
I have fixed it in my own by ending the selection DrawTool.cs onmousemove to 23:59
public void MouseMove(MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
if (m_SelectionStarted)
{
DateTime m_Time = m_DayView.GetTimeAt(e.X, e.Y);
//if (m_Time.Day == m_SelectionStart.Day)
//{
if (m_Time <= m_SelectionStart)
{
m_DayView.SelectionStart = m_Time;
//m_DayView.SelectionEnd = m_SelectionStart;
}
else
{
if (m_Time.Hour == 23 && m_Time.Minute == 30)
m_Time = m_Time.AddMinutes(29);
else
m_Time = m_Time.AddMinutes(30);
m_DayView.SelectionEnd = m_Time;
} ......
this introduce a problem when you move and appointment ending at 23:59
So in mousemove in the SelectionTool I added:
case Mode.Move:
if (m_Date.Minute == 59)
m_Date = m_Date.AddMinutes(1);
// add delta value
m_Date = m_Date.Add(delta);
I thing that was the only thinks I did to make it possible to select almost 24 hours..
|
|
|
|
|
I have implemented your solution. Unfortunately I can only mark days from 00:00-11:45 (11:45-00:00 cannot be marked). Maybe it would be a scaling problem?
|
|
|
|
|
Thats funny.. If you like, I can take a look at it if you e-mail me your project/dayview control source. Maybe there is a bug somewhere or something is missing.. I'll debug my way through it.
mail me at: ces (a] 7t d0t dk
|
|
|
|
|
hi please need help!!! i need to show 31 days in the dayview but without day's name...
can i remove it??? thanks!!!
PS: i am from argentina...my english sucks!
PS: great job!!! very nice control!!!
|
|
|
|
|
Hi
First of ALL GREATE control.
I have study this FAQ, but there is no sugestions how to make multi day appointment.
(some discussion about the problem, is done but no code it)
can this bee done with current calender?
|
|
|
|
|
I have updated control to show multiday events. You can download from http://www.codeplex.com/calendar site.
|
|
|
|
|
I have added this control to my project and I can add a dayview control to my form. Now, the problem is ... how do I create a new appointment? Do I need a class() for that? Anyone have an example?
Or another way to put a calendar/dayview/monthview to my project?
|
|
|
|
|
you have to handle ResolveAppointments events to show appointments. see example project.
|
|
|
|
|
I am trying to download the source code from Codeplex[^], but nothing happens after I click the I Agree button and choose a place to save the file to.
Any idea what the problem can be?
I tried both Firefox and IE.
|
|
|
|
|
Looks like codeplex has lost all source code. (i dont know why or how) I'm trying to upload again now, i'll inform you after the upload is complete.
|
|
|
|
|
This is their reply (I e-mailed them about the problem):
At 3pm PDT on April 11th an operator error occurred that caused source control and issue tracker data on one of the Microsoft CodePlex servers to be accidentally overwritten. During the standard data recovery effort, a recovery backup configuration oversight was discovered in the routine backup process for this CodePlex server which is currently impacting immediate restoration of the data.
Note: The content in the Wiki as well as the release files have not been affected. This current outage only affects projects that were hosted on TFS03.
We are working on this situation as a matter of highest priority. All affected projects will have their source control and issue tracker functionality restored soon but the status of the source control and issue tracker data remains unknown at this time. We will report back with a status update by close of business today, Monday, April 16, 2007 PST.
We sincerely apologize for the inconvenience this may have caused. The necessary corrections are already in place to ensure this situation will not occur again.
The CodePlex Team
http://www.codeplex.com/ContactUs.aspx
|
|
|
|
|
I have uploaded sources again. Can you download now ?
|
|
|
|
|
|
Great control expect for one thing, how do i delete an appointment?
|
|
|
|
|
Nevermind worked it out (im abit slow on a monday!) thanks
|
|
|
|
|
Following is a set of appointment - these actually are real times for a day. They present overlaps and that is not good. I have been unable to figure out where the problem is.
// For testing, set appointment for tomorrow
int thisYear = m_Date.Year;
int thisMonth = m_Date.Month;
int thisDay = m_Date.Day;
m_Appointment.StartDate = new DateTime(thisYear, thisMonth, thisDay, 7, 30, 0);
m_Appointment.EndDate = new DateTime(thisYear, thisMonth, thisDay, 14, 0, 0);
m_Appointment.Title = "My test 1";
m_Appointments.Add(m_Appointment);
m_Appointment = new Appointment();
m_Appointment.StartDate = new DateTime(thisYear, thisMonth, thisDay, 8, 30, 0);
m_Appointment.EndDate = new DateTime(thisYear, thisMonth, thisDay, 14, 0, 0);
m_Appointment.Title = "My test 2";
m_Appointments.Add(m_Appointment);
m_Appointment = new Appointment();
m_Appointment.StartDate = new DateTime(thisYear, thisMonth, thisDay, 7, 30, 0);
m_Appointment.EndDate = new DateTime(thisYear, thisMonth, thisDay, 13, 50, 0);
m_Appointment.Title = "My test 3";
m_Appointments.Add(m_Appointment);
m_Appointment = new Appointment();
m_Appointment.StartDate = new DateTime(thisYear, thisMonth, thisDay, 12, 34, 0);
m_Appointment.EndDate = new DateTime(thisYear, thisMonth, thisDay, 13, 30, 0);
m_Appointment.Title = "My test 4";
m_Appointments.Add(m_Appointment);
m_Appointment = new Appointment();
m_Appointment.StartDate = new DateTime(thisYear, thisMonth, thisDay, 7, 30, 0);
m_Appointment.EndDate = new DateTime(thisYear, thisMonth, thisDay, 13, 45, 0);
m_Appointment.Title = "My test 5";
m_Appointments.Add(m_Appointment);
m_Appointment = new Appointment();
m_Appointment.StartDate = new DateTime(thisYear, thisMonth, thisDay, 7, 30, 0);
m_Appointment.EndDate = new DateTime(thisYear, thisMonth, thisDay, 13, 45, 0);
m_Appointment.Title = "My test 5a";
m_Appointments.Add(m_Appointment);
m_Appointment = new Appointment();
m_Appointment.StartDate = new DateTime(thisYear, thisMonth, thisDay, 7, 55, 0);
m_Appointment.EndDate = new DateTime(thisYear, thisMonth, thisDay, 8, 30, 0);
m_Appointment.Title = "My test 6";
m_Appointments.Add(m_Appointment);
m_Appointment = new Appointment();
m_Appointment.StartDate = new DateTime(thisYear, thisMonth, thisDay, 7, 30, 0);
m_Appointment.EndDate = new DateTime(thisYear, thisMonth, thisDay, 9, 30, 0);
m_Appointment.EndDate = new DateTime(thisYear, thisMonth, thisDay, 13, 30, 0);
m_Appointment.Title = "My test 7";
m_Appointments.Add(m_Appointment);
m_Appointment = new Appointment();
m_Appointment.StartDate = new DateTime(thisYear, thisMonth, thisDay, 9, 00, 0);
m_Appointment.EndDate = new DateTime(thisYear, thisMonth, thisDay, 14, 45, 0);
m_Appointment.Title = "My test 8";
m_Appointments.Add(m_Appointment);
//I hope someone can ascertain which routine in DrawAppointments is in error.
David
|
|
|
|
|
The key to understanding this behavior is to study the conflict count, group properties, and halfhourlayouts. Also realize that dayview is designed for 1/2 hour increments and thus the layouts are optimized for half hour rectangles.
You will need to do some work on HalfHourLayouts.
Sorry for little detail, but it's not really an "error", just the way the code is written.
|
|
|
|
|
I use yor control in my project and it work very well, but i have a little problem.
I have myApponintment inherit by Appontment, when i change the end hour by drag top margin of apponitment, i want to change end hour on my dbtable.
How can do it, I don't find an event for this action.
Thank you for yor help and sorry for my english
Francesca Nardi
|
|
|
|
|
You need to create a custom appointment class and override the OnEndDateChanged() method to receive notifications.
class MyAppointment : Appointment
{
protected override void OnEndDateChanged()
{
// db update
}
}
You may use other protected methods to update db.
|
|
|
|
|
Thank you
I have find a problem in your control.
If I select un appointment and after change day, the selected appointment remain visible in the current day.
I adjust this problem set editbox.visible = false.
Also I ask you if you add a property ReadOnly to appointment for not change edit mode if you click on appointment; I manage the appointment information from a custom form and this is not very likeable.
Thank you
Francesca Nardi
|
|
|
|
|
I need to create appointments of 15 or 22 minutes for instance. As well grid`s appearance should stay changeless. I mean what should I do to change the interval of selection from the "halfhour" to one minute. So I`d be able to select area of 16 minutes and set new appointment.
Help me please! Thanks
In code we trust
|
|
|
|
|
If I understand correctly that what you're trying to do is make the control work in one minute instead of half hour intervals, this is not possible with the current code.
|
|
|
|
|