Version

AutoAppointmentCreate Property (UltraDayView)

Returns or sets whether a new Appointment is automatically created and placed in edit mode when the user has time slots selected and presses the enter key.
Syntax
'Declaration
 
Public Property AutoAppointmentCreate As Boolean
public bool AutoAppointmentCreate {get; set;}
Remarks

When this property is set to true an Appointment is automatically created when the user presses the Enter key and one or more time slots is selected.

Note: The created appointment is not added to the Appointments collection immediately.

Instead, the BeforeAppointmentEdited event is raised. If the user presses the Enter key again then the appointment is added to the collection. However, if the user presses Escape the appointment is cancelled and the time slots are re-selected.

Example
The following code sample demonstrates how to use the AutoAppointmentCreate property to prevent automatic appointment creation for a particular owner.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule

    Private Sub UltraDayView1_AfterActiveOwnerChanged(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinSchedule.AfterActiveOwnerChangedEventArgs) Handles UltraDayView1.AfterActiveOwnerChanged
        Dim ultraDayView As ultraDayView = DirectCast(sender, ultraDayView)

			'	If the new ActiveOwner is the unassigned owner, disallow automatic appointment creation
        If Not e.NewActiveOwner Is Nothing AndAlso e.NewActiveOwner Is ultraDayView.CalendarInfo.Owners.UnassignedOwner Then
            ultraDayView.AutoAppointmentCreate = False
        Else
            ultraDayView.AutoAppointmentCreate = True
        End If
    End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;
using System.Diagnostics;

		private void ultraDayView1_AfterActiveOwnerChanged(object sender, Infragistics.Win.UltraWinSchedule.AfterActiveOwnerChangedEventArgs e)
		{
			UltraDayView ultraDayView = sender as UltraDayView;

			//	If the new ActiveOwner is the unassigned owner, disallow automatic appointment creation
			if ( e.NewActiveOwner != null &&
				  e.NewActiveOwner == ultraDayView.CalendarInfo.Owners.UnassignedOwner )
				ultraDayView.AutoAppointmentCreate = false;
			else
				ultraDayView.AutoAppointmentCreate = true;

		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also