Hi Lyubo,
I got where my issue is! Let's say I have 20 individual contacts on my calendar now, 15 of them have same name (contact.FirstName, for example all of the 15 contacts are named "Tom") and rest 5 have another same name (contact.FirstName, for example all of the rest 5 contacts are named "Jerry").
At this moment I have 20 lines on the calendar standing for 20 appointments, but actually there are only two different names, "Tom" and "Jerry". Is there any way to group the same names into one name? EXP there are 15 "Tom"s on the left of the calendar, I would like to set to only one "Tom" but still 15 lines of appointments.
Attention there are 20 individual appointments(15 "Tom"s, 5 "Jerry"s), I can't merge them into 1 "Tom" and 1 "Jerry".
Btw in each appointment I have multiple time periods in one line without overlap. That's why I asked the previous question, but now I realized my real issues is not overlap but grouping.
Looking forward your reply, thank you Lyubo
-------------------------------------------------------
Lol, just discussed with my colleague, forget about what I asked above. There won't be duplicate names in the future!
Right now I am working on customizing the "New Appointment" window, working on how to get the value from subject line and remove location droplist, put event type droplist instead of it, and the value in the droplist should be fixed.
Again, thank you very much!
Lyubo wrote on Feb 26
th, 2014 at 10:25am:
Xylon wrote on Feb 25
th, 2014 at 3:18pm:
Could you please explain a little bit more about how to modify the "New Appointment" window?
This topic in the documentation shows one approach in customizing the forms - by handling the
FormShow event - it is also demonstrated in the 'Clients Events' sample.
The 'Stock Forms' sample shows how you can create and display your own popup forms, using the CSS classes, that the built-in forms use.
You can style the forms through CSS. The classes that the forms use are listed in a table
here.
In addition, you can use the
Calendar.LocalizationInfo property as a way to set the text in the various form labels.
Xylon wrote on Feb 25
th, 2014 at 8:06pm:
If there any easy way to import multiple appointments with one contact?
Exp, contact "Tom", he has one appointment from 3/01 -3/03, then another appointment from 3/04 - 3/07, how can I import the two appointments then put them in one line not two lines in the calendar?
It is as easy as creating multiple Appointment objects, assigning them the contact, and then adding the Appointment objects the the Schedule.Items collection:
Contact c = new Contact();
c.FirstName = "Tom";
// Add the contact to the Schedule
_calendar.Schedule.Contacts.Add(c);
// Add the contact to the calendar grouping collection
_calendar.Contacts.Add(c);
var app = new Appointment();
app.Subject = "First Appointment";
app.StartTime = new DateTime(2014, 3, 1);
app.EndTime = new DateTime(2014, 3, 3);
// Assign the contact to the appointment
app.Contacts.Add(c);
// Add the appointment to the Schedule
_calendar.Schedule.Items.Add(app);
// Create the second appointment in the same way
app = new Appointment();
app.Subject = "Second Appointment";
app.StartTime = new DateTime(2014, 3, 4);
app.EndTime = new DateTime(2014, 3, 7);
app.Contacts.Add(c);
_calendar.Schedule.Items.Add(app);
The above code puts the appointments in one line in my test (see the first attached picture). Are you sure you're assigning the same contact to the appointments? If two or more appointments' time periods overlap, they will be placed on different rows within the grouped (contact) row - you can see an example of that in the second attachment - there the second appointment is moved to start from 03/02.
Xylon wrote on Feb 25
th, 2014 at 8:06pm:
Let's say there is an appointment already existing on the calendar, now I want to add new appointment time period into the existing one from my datatable, so after that the appointment contains two time periods.
The Appointment class represents a single event which is scheduled to occur at a specified time and has a specified duration - defined by the StartTime and EndTime properties - so you cannot assign more than one time period for one Appointment instance.
If this second time period in the database represents a different event - you should create a second appointment.
If it in some way is meant to change the existing time period - move it, extend it, shrink it, etc. - you should modify the StartTime/EndTime values of the existing appointment.
If it represents a event which occurs repeatedly in time - i.e. a birthday occurs every year, a paycheck will arrive every week/month, etc. - you should use a
Recurrent appointment (you can find additional information about recurrences
here).
If you provide me with more details regarding your specific case, I may be able to give you a more concrete answer on how to approach this case.
Regards,
Lyubo