Hello,
On the appointment tab, I want to display a persons name and then the appointment time. As it is now, it displays the appointment time first. Is there a way I can place that appointment time after a persons name?
Greg
Hi Greg,
you can display your own custom appointment form. Have a look at the AppointmentDialog2007 sample, typically installed in:
C:\Users\Public\Documents\Infragistics\NetAdvantage for .NET 2007 Vol. 3 CLR 2.0\Samples\WinForms\WinSchedule\CS\AppointmentDialog2007 CS
Hope this helps.
Hi,
I'm using NetAdvantage 2005 Volume 3 CLR 2.0 and programming in c#. I looked at all the samples that's installed and didn't find what I was looking for. I'll keep looking!
Thanks,Greg
I'm not sure if the sample is already included in 2005v3, but there's a knowledgebase entry on that topic, too:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=3882
Maybe that's what you're looking for?
Here's something what I'm looking for.
private void ultraCalendarInfo1_BeforeDisplayAppointmentDialog(object sender, Infragistics,Win.UltraWinSchedule.DisplayAppointmentDialogEventArgs e)
{
e.Cancel = true;
e.Appointment.Subject = "John Doe" + "(" + e.Appointment.StartDateTime.ToShortTimeString() + "-" + e.Appointment.EndDateTime.ToShortTimeString() + ")";
if(!e.IsExistingAppointment)
this.ultraCalendarInfo1.Appointments.Add(e.Appointment);
}
I'm looking for a way to update the subject time whenever the appointment is moved or resized.
That was exactly what I was looking for! Thanks Brian and Andre for your help!
Another approach would be to use the CalendarInfoChanged event and respond directly to changes in the values of the Appointment properties.
Example:
this.dayView.CalendarInfo.CalendarInfoChanged += new CalendarInfoChangedEventHandler(this.OnCalendarInfoChanged);
private void OnCalendarInfoChanged(object sender, CalendarInfoChangedEventArgs e){ Infragistics.Shared.PropChangeInfo pci = e.PropChangeInfo.FindTrigger( null ); Appointment appointment = pci != null ? pci.Source as Appointment : null; if ( appointment != null ) { if ( pci.PropId is PropertyIds && ((PropertyIds)pci.PropId == PropertyIds.StartDateTime || (PropertyIds)pci.PropId == PropertyIds.EndDateTime || (PropertyIds)pci.PropId == PropertyIds.Subject) ) { appointment.Subject = string.Format( "John Doe ({0} - {1})", appointment.StartDateTime, appointment.EndDateTime ); } }}
I included the Subject property in the above example because if the appointment is modified via the appointment dialog, the subject will be overwritten if you don't include this.
Note that this covers the cases where the appointment is modified through the user interface, but it does not cover the case where a new Appointment is added. You could use the AfterAppointmentAdded event to handle that case...I'm not sure if your objective is to always change the subject to display the start and end times or if you only want to do it when it is resized or moved, but if you always want it to sync up with the start and end times handling resizing and moving alone will not do it.
Thanks Andre!
In the BeforeAppointmentResized event, I was able to write this code,
e.Appointment.Subject = "Name" + " (" + e.NewStartTime.ToShortTimeString() + "-" + e.NewEndTime.ToShortTimeString() + ")";
which worked out great! But I haven't been able to get the same result in the AppointmentsDragComplete event. I'm halfway there though!
have a look at the BeforeAppointmentResized event and the AppointmentsDragComplete event of the UltraDayView class. These should be the right points to call your code.