Version

InitializeMonthViewSingle Event

Invoked when an UltraMonthViewSingle control is created for the print operation.
Syntax
'Declaration
 
Public Event InitializeMonthViewSingle As InitializeMonthViewSingleEventHandler
public event InitializeMonthViewSingleEventHandler InitializeMonthViewSingle
Event Data

The event handler receives an argument of type InitializeMonthViewSingleEventArgs containing data related to this event. The following InitializeMonthViewSingleEventArgs properties provide information specific to this event.

PropertyDescription
Control Returns the Infragistics.Win.UltraWinSchedule.UltraMonthViewSingle control that will be used for the print operation.
Remarks

The UltraSchedulePrintDocument creates instances of the various schedule controls in order to render the calendar information to the printer. When the control is created, it is initialized based on the respective 'Template' property (e.g. TemplateMonthViewSingle) and then the associated initialize event (e.g. InitializeMonthViewSingle) is invoked to allow any further customizations to the control.

Example
The following sample demonstrates how to use the 'InitializeMonthViewSingle' event to initialize the properties of the UltraMonthViewSingle created by the UltraSchedulePrintDocument for a print operation.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'print a monthly view
        Me.UltraSchedulePrintDocument1.PrintStyle = SchedulePrintStyle.Monthly

        ' add an additional owner
        Me.UltraSchedulePrintDocument1.CalendarInfo.Owners.Add(Environment.UserName)
    End Sub

    Private Sub UltraSchedulePrintDocument1_InitializeMonthViewSingle(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinSchedule.Printing.InitializeMonthViewSingleEventArgs) Handles UltraSchedulePrintDocument1.InitializeMonthViewSingle
        'some general properties will be available regardless of 
        'the print style...

        'render the time as clock images
        e.Control.TimeDisplayStyle = TimeDisplayStyleEnum.Clock

        'only render appointments
        e.Control.ActivityDisplayStyle = ActivityDisplayStyleEnum.Appointments


        'some properties like the following may be overriden when using
        'some print style (e.g. trifold). however, this can be used
        'in a monthly print style to control how many owners are printed
        'per page
        e.Control.OwnerDisplayStyle = OwnerDisplayStyle.Separate
        e.Control.MaximumOwnersInView = 2
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;

		private void Form1_Load(object sender, System.EventArgs e)
		{
			//print a monthly view
			this.ultraSchedulePrintDocument1.PrintStyle = SchedulePrintStyle.Monthly;


			// add an additional owner
			this.ultraSchedulePrintDocument1.CalendarInfo.Owners.Add(Environment.UserName);
		}

		private void ultraSchedulePrintDocument1_InitializeMonthViewSingle(object sender, Infragistics.Win.UltraWinSchedule.Printing.InitializeMonthViewSingleEventArgs e)
		{
			//some general properties will be available regardless of 
			//the print style...

			//render the time as clock images
			e.Control.TimeDisplayStyle = TimeDisplayStyleEnum.Clock;

			//only render appointments
			e.Control.ActivityDisplayStyle = ActivityDisplayStyleEnum.Appointments;

			//some properties like the following may be overriden when using
			//some print style (e.g. trifold). however, this can be used
			//in a monthly print style to control how many owners are printed
			//per page
			e.Control.OwnerDisplayStyle = OwnerDisplayStyle.Separate;
			e.Control.MaximumOwnersInView = 2;
		}
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